{"id":33029,"date":"2023-12-11T01:52:49","date_gmt":"2023-10-03T22:14:16","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/"},"modified":"2024-05-04T13:02:04","modified_gmt":"2024-05-04T05:02:04","slug":"%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/","title":{"rendered":"\u5728CentOS7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx"},"content":{"rendered":"<h1>\u4f7f\u7528yum\u8fdb\u884c\u5b89\u88c5\u3002<\/h1>\n<p>\u5982\u679c\u53ea\u7528\u4f5cWeb\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u901a\u8fc7yum\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<pre class=\"post-pre\"><code>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\nyum install nginx\r\n\u78ba\u8a8d\r\nnginx -v\r\n\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u6240\r\ncd \/etc\/nginx\r\n\u8d77\u52d5\r\nsystemctl start nginx\r\n\u7d42\u4e86\r\nsystemctl stop nginx\r\nOS\u8d77\u52d5\u6642\u306b\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3059\u308b\r\nsystemctl enable nginx\r\nOS\u8d77\u52d5\u6642\u306b\u8d77\u52d5\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\r\nsystemctl disable nginx\r\n<\/code><\/pre>\n<h1>\u7528yum\u8fdb\u884c\uff08\u6700\u65b0\u7248\uff09\u5b89\u88c5<\/h1>\n<p>\u901a\u8fc7\u4f7f\u7528\u5b98\u65b9\u7684\u8f6f\u4ef6\u5e93\uff0c\u53ef\u4ee5\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684nginx\uff0c\u800c\u4e0a\u8ff0\u65b9\u6cd5\u5374\u5b89\u88c5\u4e86\u65e7\u7248\u672c\u7684nginx\u3002<\/p>\n<p>\u6dfb\u52a0\u5b58\u50a8\u5e93<\/p>\n<pre class=\"post-pre\"><code>sudo vi \/etc\/yum.repos.d\/nginx.repo\r\n<\/code><\/pre>\n<p>\u8bf7\u5c06\u4ee5\u4e0b\u5185\u5bb9\u586b\u5199\u5728\u7eb8\u4e0a\u3002<\/p>\n<pre class=\"post-pre\"><code>[nginx]\r\nname=nginx repo\r\nbaseurl=http:\/\/nginx.org\/packages\/mainline\/centos\/7\/$basearch\/\r\ngpgcheck=0\r\nenabled=1\r\n<\/code><\/pre>\n<p>\u5b89\u88c5Nginx\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo yum install nginx\r\n<\/code><\/pre>\n<p>\u786e\u8ba4\u7248\u672c<\/p>\n<pre class=\"post-pre\"><code>nginx -v\r\n<\/code><\/pre>\n<p>\u81ea\u52a8\u542f\u52a8\u8bbe\u7f6e<\/p>\n<pre class=\"post-pre\"><code>sudo systemctl enable nginx\r\n<\/code><\/pre>\n<p>\u542f\u52a8<\/p>\n<pre class=\"post-pre\"><code>sudo systemctl start nginx\r\n<\/code><\/pre>\n<h1>\u4ece\u6e90\u4ee3\u7801\u5b89\u88c5<\/h1>\n<p>\u5982\u679c\u9700\u8981\u5b89\u88c5\u7279\u6b8a\u7684\u6a21\u5757\uff0c\u5219\u9700\u8981\u4ece\u6e90\u4ee3\u7801\u8fdb\u884c\u5b89\u88c5\u3002<br \/>\n\u5728nginx\u4e2d\uff0c\u6ca1\u6709\u52a8\u6001\u5e93\uff0c\u53ea\u6709\u9759\u6001\u5e93\uff0c\u56e0\u6b64\u5982\u679c\u9700\u8981\u5fc5\u8981\u7684\u5916\u90e8\u6a21\u5757\uff0c\u5219\u9700\u8981\u4ece\u6e90\u4ee3\u7801\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p>\u9019\u6b21\u7684\u60c5\u6cc1\u662f\u5b89\u88dd\u4e86 RTMP \u6a21\u7d44\u3002<\/p>\n<pre class=\"post-pre\"><code>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\r\nwget http:\/\/nginx.org\/download\/nginx-1.13.5.tar.gz\r\ntar -zxvf nginx-1.13.5.tar.gz\r\nrtmp\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u53d6\u5f97\r\ngit clone https:\/\/github.com\/arut\/nginx-rtmp-module\r\ncd nginx-1.13.5\r\n.\/configure --with-http_ssl_module --with-http_realip_module --with-http_v2_module --add-module=..\/nginx-rtmp-module-master\r\nmake\r\nmake install\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>\u8d77\u52d5\r\nsudo \/usr\/local\/nginx\/sbin\/nginx\r\n\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\r\nvi \/usr\/local\/nginx\/conf\/nginx.conf\r\n\u518d\u8aad\u307f\u8fbc\u307f\r\n\/usr\/local\/nginx\/sbin\/nginx -s reload\r\n\u7d42\u4e86\r\n\/usr\/local\/nginx\/sbin\/nginx -s stop\r\n\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\r\nvi \/usr\/lib\/systemd\/system\/nginx.service\r\n[Unit]\r\nDescription=The NGINX HTTP and reverse proxy server\r\nAfter=syslog.target network.target remote-fs.target nss-lookup.target\r\n\r\n[Service]\r\nType=forking\r\nRemainAfterExit=yes\r\nExecStartPre=\/usr\/local\/nginx\/sbin\/nginx -t\r\nExecStart=\/usr\/local\/nginx\/sbin\/nginx\r\nExecReload=\/usr\/local\/nginx\/sbin\/nginx -s reload\r\nExecStop=\/usr\/local\/nginx\/sbin\/nginx -s stop\r\nPrivateTmp=true\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\nsystemctl daemon-reload\r\nsystemctl enable nginx\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528yum\u8fdb\u884c\u5b89\u88c5\u3002 \u5982\u679c\u53ea\u7528\u4f5cWeb\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u901a\u8fc7yum\u8fdb\u884c\u5b89\u88c5\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb yum inst [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33029","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728CentOS7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728centos7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6enginx\u3002-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728CentOS7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx\" \/>\n<meta property=\"og:description\" content=\"\u4f7f\u7528yum\u8fdb\u884c\u5b89\u88c5\u3002 \u5982\u679c\u53ea\u7528\u4f5cWeb\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u901a\u8fc7yum\u8fdb\u884c\u5b89\u88c5\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb yum inst [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728centos7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6enginx\u3002-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-03T22:14:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-04T05:02:04+00:00\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/\",\"name\":\"\u5728CentOS7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-10-03T22:14:16+00:00\",\"dateModified\":\"2024-05-04T05:02:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728CentOS7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728CentOS7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728centos7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6enginx\u3002-2\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728CentOS7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx","og_description":"\u4f7f\u7528yum\u8fdb\u884c\u5b89\u88c5\u3002 \u5982\u679c\u53ea\u7528\u4f5cWeb\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u901a\u8fc7yum\u8fdb\u884c\u5b89\u88c5\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb yum inst [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728centos7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6enginx\u3002-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-10-03T22:14:16+00:00","article_modified_time":"2024-05-04T05:02:04+00:00","author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/","name":"\u5728CentOS7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-10-03T22:14:16+00:00","dateModified":"2024-05-04T05:02:04+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728CentOS7\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos7%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aenginx%e3%80%82-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=33029"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33029\/revisions"}],"predecessor-version":[{"id":98475,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33029\/revisions\/98475"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=33029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=33029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=33029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}