{"id":2021,"date":"2021-11-16T16:29:25","date_gmt":"2021-11-16T08:29:25","guid":{"rendered":"https:\/\/199604.com\/?p=2021"},"modified":"2021-11-16T16:48:37","modified_gmt":"2021-11-16T08:48:37","slug":"nginx%e7%9a%84%e5%b9%b3%e6%bb%91%e5%8d%87%e7%ba%a7%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/199604.com\/2021","title":{"rendered":"Nginx\u7684\u5e73\u6ed1\u5347\u7ea7(\u7f16\u8bd1\u5b89\u88c5\u65b9\u5f0f)"},"content":{"rendered":"<h2><strong>Nginx\u7684\u5e73\u6ed1\u5347\u7ea7<\/strong><\/h2>\n<h3>1\u3001\u67e5\u770b\u5f53\u7136\u7248\u672c<\/h3>\n<pre><code class=\"language-shell line-numbers\">cd \/usr\/local\/nginx\/ #\u8fdb\u5165Nginx\u5b89\u88c5\u76ee\u5f55\nsbin\/nginx -V #\u67e5\u770b\u7248\u672c\n----\u8f93\u51fa\nnginx version: nginx\/1.14.0\nbuilt by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) \nconfigure arguments: \u2013user=www \u2013group=www \u2013prefix=\/usr\/local\/nginx \u2013with-http_stub_status_module \u2013with-http_ssl_module #\u7f16\u8bd1\u9879\u5f97\u5230\u539f\u6765.\/configure \u7684\u7f16\u8bd1\u9879\n<\/code><\/pre>\n<h3>2.\u4e0b\u8f7d\u6700\u65b0\u7248<\/h3>\n<p>\u524d\u5f80\u67e5\u770b\u6700\u65b0\u7248\uff0chttp:\/\/nginx.org\/en\/download.html<\/p>\n<pre><code class=\"language-shell line-numbers\">cd \/data\/soft\/\nwget http:\/\/nginx.org\/download\/nginx-1.21.4.tar.gz #\u4e0b\u8f7d\ntar xzvf nginx-1.21.4.tar.gz #\u89e3\u538b\u7f29\ncd nginx-1.21.4\n<\/code><\/pre>\n<h3>3.\u7f16\u8bd1<\/h3>\n<pre><code class=\"language-shell line-numbers\">.\/configure \u2013user=www \u2013group=www \u2013prefix=\/usr\/local\/nginx \u2013with-http_stub_status_module \u2013with-http_ssl_module #\u6309\u539f\u6765\u7684\u9009\u9879configure\nmake #\u7f16\u8bd1\nmv \/usr\/local\/nginx\/sbin\/nginx \/usr\/local\/nginx\/sbin\/nginx.old #\u79fb\u52a8\u65e7\u7248\u672c\ncp objs\/nginx \/usr\/local\/nginx\/sbin\/ #\u590d\u5236\u65b0\u7248\u672cnginx\u8fc7\u53bb\ncd \/usr\/local\/nginx\nsbin\/nginx -t #\u6d4b\u8bd5\u4e0b\uff0c\u663e\u793a\u5982\u4e0b\u5c31\u662f\u901a\u8fc7\n----\u8f93\u51fa\nthe configuration file \/usr\/local\/nginx\/conf\/nginx.conf syntax is ok\nconfiguration file \/usr\/local\/nginx\/conf\/nginx.conf test is successful\n\n# \u6216\u8005\nmv \/usr\/local\/nginx mv \/usr\/local\/nginx_bak #\u79fb\u52a8\u65e7\u7248\u672c\n.\/configure \u2013user=www \u2013group=www \u2013prefix=\/usr\/local\/nginx \u2013with-http_stub_status_module \u2013with-http_ssl_module #\u6309\u539f\u6765\u7684\u9009\u9879configure\nmake #\u7f16\u8bd1\nmake install\ncd \/usr\/local\/nginx\nsbin\/nginx -t #\u6d4b\u8bd5\u4e0b\uff0c\u663e\u793a\u5982\u4e0b\u5c31\u662f\u901a\u8fc7\n<\/code><\/pre>\n<h3>4.\u542f\u52a8\u65b0\u7684\uff0c\u5173\u6389\u65e7\u7684<\/h3>\n<pre><code class=\"language-shell line-numbers\"># \u8ba9nginx\u628anginx.pid\u6539\u6210nginx.pid.oldbin \u8ddf\u7740\u542f\u52a8\u65b0\u7684nginx\nkill -USR2 `cat \/usr\/local\/nginx\/nginx.pid`\n# \u9000\u51fa\u65e7\u7684nignx\nkill -QUIT `cat \/usr\/local\/nginx\/nginx.pid.oldbin`\n\n# \u6216\u8005 \u76f4\u63a5\u91cd\u542f....\n\/usr\/local\/nginx\/sbin\/nginx -s reload -c \/home\/zxw\/app\/nginx\/nginx.AH.conf\n<\/code><\/pre>\n<h3>5.\u5347\u7ea7\u5b8c\u6210\u3002<\/h3>\n<pre><code class=\"language-shell line-numbers\">sbin\/nginx -V\n----\u8f93\u51fa\nnginx version: nginx\/1.21.4\nbuilt by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) \nconfigure arguments: --user=www --group=www --prefix=\/usr\/local\/nginx --with-http_stub_status_module --with-http_ssl_module \n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Nginx\u7684\u5e73\u6ed1\u5347\u7ea7 1\u3001\u67e5\u770b\u5f53\u7136\u7248\u672c cd \/usr\/local\/nginx\/ #\u8fdb\u5165Nginx\u5b89\u88c5\u76ee\u5f55 s [&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,283],"tags":[215],"class_list":["post-2021","post","type-post","status-publish","format-standard","hentry","category-linux","category-nginx","tag-nginx"],"_links":{"self":[{"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/posts\/2021","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=2021"}],"version-history":[{"count":3,"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/posts\/2021\/revisions"}],"predecessor-version":[{"id":2024,"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/posts\/2021\/revisions\/2024"}],"wp:attachment":[{"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/media?parent=2021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/categories?post=2021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/199604.com\/wp-json\/wp\/v2\/tags?post=2021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}