{"id":2249,"date":"2022-05-18T16:54:56","date_gmt":"2022-05-18T08:54:56","guid":{"rendered":"https:\/\/199604.com\/?p=2249"},"modified":"2022-05-18T16:54:56","modified_gmt":"2022-05-18T08:54:56","slug":"centos7-srs%e6%b5%81%e5%aa%92%e4%bd%93%e7%b3%bb%e7%bb%9f%e6%9c%8d%e5%8a%a1%e6%90%ad%e5%bb%ba","status":"publish","type":"post","link":"https:\/\/199604.com\/2249","title":{"rendered":"centos7-SRS\u6d41\u5a92\u4f53\u7cfb\u7edf\u670d\u52a1\u642d\u5efa"},"content":{"rendered":"<h1>centos7-SRS\u6d41\u5a92\u4f53\u7cfb\u7edf\u670d\u52a1\u642d\u5efa<\/h1>\n<p>\u6709\u65f6\u5019\u542f\u52a8\u6ca1\u6709\u95ee\u9898\uff0c\u4f46\u662f\u5c31\u662f\u770b\u4e0d\u4e86\uff0c\u539f\u56e0\u662f\u9632\u706b\u5899\u548cselinux\u5f00\u7740<\/p>\n<h3>\u521d\u59cb\u5316\u7cfb\u7edfselinux\u3001firewalld\u7b56\u7565<\/h3>\n<h4>\u8bbe\u7f6eselinux<\/h4>\n<pre><code class=\"language-shell \">sed -i 's\/SELINUX=enforcing\/SELINUX=disabled\/g' \/etc\/sysconfig\/selinux\nsed -i 's\/SELINUX=enforcing\/SELINUX=disabled\/g' \/etc\/selinux\/config\nsetenforce 0\n<\/code><\/pre>\n<h4>\u8bbe\u7f6efirewalld\u7b56\u7565\uff08\u5173\u95ed\u9632\u706b\u5899\uff09<\/h4>\n<pre><code class=\"language-shell \">systemctl stop firewalld\nsystemctl disable firewalld\n\n# yum -y install iptables-services &amp;&amp; systemctl start iptables &amp;&amp; systemctl enable  iptables  &amp;&amp; iptables -F &amp;&amp; service iptables  save\n<\/code><\/pre>\n<h3><strong>\u5b89\u88c5\u4f9d\u8d56\u73af\u5883<\/strong><\/h3>\n<pre><code class=\"language-shell \">yum install cpp libgcc glibc-devel glibc zlib zlib-devel libgomp\nyum install flex byacc libpcap libpcap-devel ncurses ncurses-devel\nyum install gcc gcc-c++ autoconf automake\n<\/code><\/pre>\n<blockquote><p>\n  yum install gcc \u5fc5\u987b\u5b89\u88c5 \u9700\u8981\u7f16\u8bd1\n<\/p><\/blockquote>\n<h3>\u4e0b\u8f7d\u6e90\u7801\uff0c\u63a8\u8350\u7528<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/ossrs\/srs\/wiki\/v4_CN_Build\">CentOS7<\/a>\u7cfb\u7edf<\/h3>\n<p><code>git clone -b 4.0release https:\/\/gitee.com\/ossrs\/srs.git<\/code><\/p>\n<blockquote><p>\n  \u5982\u679ccentos\u670d\u52a1\u6ca1 git \u9700\u8981\u5b89\u88c5<code>yum install git<\/code>\n<\/p><\/blockquote>\n<h3>\u7f16\u8bd1\u5b89\u88c5<\/h3>\n<p>\u6ce8\u610f\u9700\u8981\u5207\u6362\u5230<code>srs\/trunk<\/code>\u76ee\u5f55<\/p>\n<pre><code class=\"language-shell \">cd srs\/trunk\n.\/configure\nmake &amp;&amp; make install \n<\/code><\/pre>\n<blockquote><p>\n  \u6ce8\uff1a\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u64ad\u653e\u7684\u5730\u5740\u4e0e\u7f51\u7ad9\u5b58\u5728<strong>SRS\u8de8\u57df\u64ad\u653e\u95ee\u9898   \u53ef\u4ee5\u6309\u4e0b\u9762\u65b9\u6848\u89e3\u51b3\u6b64\u95ee\u9898 \u5728\u6b64\u4e4b\u524d\uff0c\u5343\u4e07\u4e00\u5b9a\u4e0d\u8981\u6267\u884c\u7f16\u8bd1\uff01<\/strong><\/p>\n<pre><code class=\"language-shell \">#cd srs\/trunk\n#vi src\/app\/srs_app_http_stream.cpp\n#\u5728w-&gt;header()-&gt;set_content_type(\"video\/x-flv\");\u4e0b\u4e00\u884c\u6dfb\u52a0\u4ee3\u7801\nw-&gt;header()-&gt;set(\"Access-Control-Allow-Origin\",\"*\");\n<\/code><\/pre>\n<h3><strong>\u7136\u540e\u76f4\u63a5\u7f16\u8bd1\u5b89\u88c5SRS<\/strong><\/h3>\n<\/blockquote>\n<h3>\u542f\u52a8\u547d\u4ee4<\/h3>\n<p><code>\/usr\/local\/srs\/objs\/srs -c \/usr\/local\/srs\/conf\/srs.conf<\/code><\/p>\n<h3>\u5176\u4ed6\u547d\u4ee4<\/h3>\n<p>\u505c\u6b62 <code>\/usr\/local\/srs\/\/etc\/init.d\/srs stop<\/code><br \/>\n\u91cd\u542f <code>\/usr\/local\/srs\/\/etc\/init.d\/srs restart<\/code><\/p>\n<h2>SRS\u4f5c\u4e3a\u7cfb\u7edf\u670d\u52a1\u542f\u52a8<\/h2>\n<p>\u94fe\u63a5\u5b89\u88c5\u76ee\u5f55\u7684<code>\/usr\/local\/srs\/\/etc\/init.d\/srs<\/code>\u5230<code>\/etc\/init.d\/srs<\/code><\/p>\n<p>\u5982\u6211\u672c\u5730\uff1a<code>ln -s \/usr\/local\/srs\/\/etc\/init.d\/srs \/etc\/init.d\/srs<\/code><\/p>\n<h3>systemctl\u670d\u52a1\u5f00\u673a\u81ea\u542f\u52a8<\/h3>\n<pre><code class=\"language-shell \">sudo ln -sf \/usr\/local\/srs\/etc\/init.d\/srs \/etc\/init.d\/srs &amp;&amp;\nsudo cp -f \/usr\/local\/srs\/usr\/lib\/systemd\/system\/srs.service \/usr\/lib\/systemd\/system\/srs.service &amp;&amp; sudo systemctl daemon-reload &amp;&amp; sudo systemctl enable srs\n<\/code><\/pre>\n<p>\u53c2\u8003\uff1ahttps:\/\/github.com\/ossrs\/srs\/wiki\/v3_CN_LinuxService<\/p>\n<p>https:\/\/www.cnblogs.com\/Pan-xi-yi\/p\/11970135.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>centos7-SRS\u6d41\u5a92\u4f53\u7cfb\u7edf\u670d\u52a1\u642d\u5efa \u6709\u65f6\u5019\u542f\u52a8\u6ca1\u6709\u95ee\u9898\uff0c\u4f46\u662f\u5c31\u662f\u770b\u4e0d\u4e86\uff0c\u539f\u56e0\u662f\u9632\u706b\u5899\u548cselinux\u5f00\u7740 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[260],"tags":[239],"class_list":["post-2249","post","type-post","status-publish","format-standard","hentry","category-linux","tag-centos7"],"_links":{"self":[{"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/posts\/2249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/comments?post=2249"}],"version-history":[{"count":1,"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/posts\/2249\/revisions"}],"predecessor-version":[{"id":2250,"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/posts\/2249\/revisions\/2250"}],"wp:attachment":[{"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/media?parent=2249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/categories?post=2249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/tags?post=2249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}