{"id":873,"date":"2021-04-12T13:05:00","date_gmt":"2021-04-12T05:05:00","guid":{"rendered":"http:\/\/www.langmanezhuang.com\/index.php\/2021\/04\/12\/nginx-centos-%e6%9c%8d%e5%8a%a1%e5%bc%80%e6%9c%ba%e5%90%af%e5%8a%a8%e8%ae%be%e7%bd%ae%e5%ae%9e%e4%be%8b%e8%af%a6%e8%a7%a3\/"},"modified":"2022-11-26T20:53:22","modified_gmt":"2022-11-26T12:53:22","slug":"nginx-centos-%e6%9c%8d%e5%8a%a1%e5%bc%80%e6%9c%ba%e5%90%af%e5%8a%a8%e8%ae%be%e7%bd%ae%e5%ae%9e%e4%be%8b%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"http:\/\/blog.langmanezhuang.com\/index.php\/2021\/04\/12\/nginx-centos-%e6%9c%8d%e5%8a%a1%e5%bc%80%e6%9c%ba%e5%90%af%e5%8a%a8%e8%ae%be%e7%bd%ae%e5%ae%9e%e4%be%8b%e8%af%a6%e8%a7%a3\/","title":{"rendered":"nginx centos \u670d\u52a1\u5f00\u673a\u542f\u52a8\u8bbe\u7f6e\u5b9e\u4f8b\u8be6\u89e3"},"content":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd\u4e86nginx centos \u670d\u52a1\u5f00\u673a\u542f\u52a8\u8bbe\u7f6e\u5b9e\u4f8b\u8be6\u89e3\u7684\u76f8\u5173\u8d44\u6599,\u8fd9\u91cc\u5bf9\u670d\u52a1\u5f00\u673a\u542f\u52a8\u505a\u4e86\u8be6\u7ec6\u7684\u6b65\u9aa4\u4ecb\u7ecd\uff0c\u9700\u8981\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e0b<\/p>\n<p>&nbsp;<\/p>\n<p><strong>nginx centos \u670d\u52a1\u5f00\u673a\u542f\u52a8\u8bbe\u7f6e<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u5efa\u7acb\u670d\u52a1\u6587\u4ef6<\/p>\n<p>\u4ee5nginx \u4e3a\u4f8b<\/p>\n<p>vim \/lib\/systemd\/system\/nginx.service&nbsp;<\/p>\n<p>\u5728nginx.service \u4e2d\u63d2\u5165\u4e00\u4e0b\u5185\u5bb9<\/p>\n<div class=\"jb51code\">&nbsp;<\/p>\n<div class=\"cnblogs_Highlighter\">\n<pre class=\"brush:html;gutter:true;\">[Unit] \nDescription=nginx \nAfter=network.target \n\n[Service] \nType=forking \nExecStart= \u670d\u52a1\u542f\u52a8\u547d\u4ee4\nExecReload= \u670d\u52a1\u91cd\u542f\u547d\u4ee4\nExecStop=\u670d\u52a1\u505c\u6b62\u547d\u4ee4\nPrivateTmp=<span style=\"color: #ff0000;\">true<\/span> \n\n[Install] \nWantedBy=multi-user.target \n<\/pre>\n<\/div>\n<p>\u3000\u3000<\/p>\n<p>[Unit]:\u670d\u52a1\u7684\u8bf4\u660e<br \/>Description:\u63cf\u8ff0\u670d\u52a1<br \/>After:\u63cf\u8ff0\u670d\u52a1\u7c7b\u522b<br \/>[Service]\u670d\u52a1\u8fd0\u884c\u53c2\u6570\u7684\u8bbe\u7f6e<br \/>Type=forking\u662f\u540e\u53f0\u8fd0\u884c\u7684\u5f62\u5f0f<br \/>ExecStart\u4e3a\u670d\u52a1\u7684\u5177\u4f53\u8fd0\u884c\u547d\u4ee4<br \/>ExecReload\u4e3a\u91cd\u542f\u547d\u4ee4<br \/>ExecStop\u4e3a\u505c\u6b62\u547d\u4ee4<br \/>PrivateTmp=True\u8868\u793a\u7ed9\u670d\u52a1\u5206\u914d\u72ec\u7acb\u7684\u4e34\u65f6\u7a7a\u95f4<br \/>\u6ce8\u610f\uff1a[Service]\u7684\u542f\u52a8\u3001\u91cd\u542f\u3001\u505c\u6b62\u547d\u4ee4\u5168\u90e8\u8981\u6c42\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84<\/p>\n<p>\u4ee5754\u7684\u6743\u9650\u4fdd\u5b58\u5728\u76ee\u5f55\uff1a\/lib\/systemd\/system&nbsp;<\/p>\n<p>\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8\uff1a<\/p>\n<p>systemctl enable nginx.service<\/p>\n<p>\u76f8\u5173\u547d\u4ee4<\/p>\n<p>\u529f\u80fd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cnetos7\u4ee5\u524d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cnetos7<br \/>\u663e\u793a\u6240\u6709\u5df2\u542f\u52a8\u7684\u670d\u52a1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chkconfig &#8211;list&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u3000\u3000\u3000\u3000\u3000\u3000&nbsp;&nbsp;&nbsp; systemctl list-units &#8211;type=service<\/p>\n<p>\u542f\u52a8\u67d0\u670d\u52a1 \u3000\u3000\u3000\u3000\u3000\u3000service nginx start systemctl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u3000\u3000&nbsp;&nbsp;&nbsp;&nbsp; start nginx.service \u6216 systemctl start nginx<\/p>\n<p>\u505c\u6b62\u67d0\u670d\u52a1 \u3000\u3000\u3000\u3000\u3000\u3000service nginx stop systemctl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u3000\u3000 stop nginx.service \u6216 systemctl stop nginx<\/p>\n<p>\u91cd\u542f\u67d0\u670d\u52a1 \u3000\u3000\u3000\u3000\u3000\u3000service nginx restart&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u3000\u3000\u3000\u3000systemctl restart nginx.service \u6216 systemctl restart nginx<\/p>\n<p>\u4f7f\u67d0\u670d\u52a1\u81ea\u52a8\u542f\u52a8 \u3000\u3000\u3000\u3000chkconfig &#8211;level 3 nginx&nbsp; on&nbsp;&nbsp;&nbsp; \u3000\u3000\u3000systemctl enable nginx.service \u6216 systemctl enable nginx<\/p>\n<p>\u4f7f\u67d0\u670d\u52a1\u4e0d\u81ea\u52a8\u542f\u52a8 \u3000\u3000\u3000\u3000chkconfig &#8211;level 3 nginx off \u3000\u3000\u3000systemctl disable nginx.service \u6216 systemctl disable nginx<\/p>\n<p>\u68c0\u67e5\u670d\u52a1\u72b6\u6001 \u3000\u3000\u3000\u3000\u3000\u3000service nginx status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u3000\u3000\u3000\u3000 systemctl is-active nginx.service \uff08\u4ec5\u663e\u793a\u662f\u5426\uff09Activesystemctl status nginx.service \uff08\u670d\u52a1\u8be6\u7ec6\u4fe1\u606f\uff09<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd\u4e86nginx centos \u670d\u52a1\u5f00\u673a\u542f\u52a8\u8bbe\u7f6e\u5b9e\u4f8b\u8be6\u89e3\u7684\u76f8\u5173\u8d44\u6599,\u8fd9\u91cc\u5bf9\u670d\u52a1\u5f00\u673a\u542f\u52a8\u505a\u4e86\u8be6\u7ec6\u7684\u6b65 &hellip; <a href=\"http:\/\/blog.langmanezhuang.com\/index.php\/2021\/04\/12\/nginx-centos-%e6%9c%8d%e5%8a%a1%e5%bc%80%e6%9c%ba%e5%90%af%e5%8a%a8%e8%ae%be%e7%bd%ae%e5%ae%9e%e4%be%8b%e8%af%a6%e8%a7%a3\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">nginx centos \u670d\u52a1\u5f00\u673a\u542f\u52a8\u8bbe\u7f6e\u5b9e\u4f8b\u8be6\u89e3<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,1],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/posts\/873"}],"collection":[{"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/comments?post=873"}],"version-history":[{"count":1,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/posts\/873\/revisions"}],"predecessor-version":[{"id":949,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/posts\/873\/revisions\/949"}],"wp:attachment":[{"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/media?parent=873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/categories?post=873"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/tags?post=873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}