{"id":83,"date":"2021-11-03T13:36:00","date_gmt":"2021-11-03T13:36:00","guid":{"rendered":"https:\/\/www.meblg.com\/?p=83"},"modified":"2022-02-11T10:52:10","modified_gmt":"2022-02-11T02:52:10","slug":"byaz19","status":"publish","type":"post","link":"https:\/\/www.meblg.com\/index.php\/jc\/byaz19\/","title":{"rendered":"debian11\u7f16\u8bd1\u5b89\u88c5nginx1.19.9"},"content":{"rendered":"<p><strong>\u66f4\u65b0\u7cfb\u7edf\u5b89\u88c5\u5305\u5217\u8868<\/strong><\/p>\n<pre><code>apt update\n<\/code><\/pre>\n<p><strong>\u5fc5\u987b\u8f6f\u4ef6\u5305\u4f9d\u8d56<\/strong><br \/>\n\u4e0b\u9762\u90fd\u662f\u7f16\u8bd1 nginx \u5fc5\u987b\u7684\uff0c\u63d0\u524d\u5b89\u88c5\u597d\u3002<\/p>\n<pre><code>apt install gcc make\napt install libpcre3 libpcre3-dev     \/\/\u3010\u6b63\u5219\u8868\u8fbe\u5f0f\u5e93\u3011\u5b98\u7f51http:\/\/www.pcre.org\/\napt install openssl libssl-dev     \/\/\u3010openssl\u5e93\u3011\u5b98\u7f51https:\/\/www.openssl.org\/\napt install zlib1g-dev\n<\/code><\/pre>\n<p><strong>\u521b\u5efa\u9700\u8981\u4f7f\u7528\u7684\u76ee\u5f55<\/strong><br \/>\n\u521b\u5efa\u76ee\u5f55 sources \u548c web\uff0c\u5206\u522b\u7528\u6765\u653e\u6e90\u7801\u548c\u7f16\u8bd1\u540e\u7684\u6587\u6863\u3002<\/p>\n<pre><code>mkdir \/sources\/\nmkdir \/web\/\n<\/code><\/pre>\n<p><strong>\u5b89\u88c5nginx<\/strong><br \/>\n\u547d\u4ee4\u6d41\u7a0b\uff1a<\/p>\n<pre><code>cd \/sources\/\nwget http:\/\/nginx.org\/download\/nginx-1.19.9.tar.gz\ntar -zxf nginx-1.19.9.tar.gz\ncd nginx-1.19.9\n.\/configure --prefix=\/web\/nginx --with-http_ssl_module\nmake &amp;&amp; make install\n<\/code><\/pre>\n<p><strong>\u6dfb\u52a0php&amp;asp\u652f\u6301<\/strong><br \/>\n\u6253\u5f00 nginx.conf<\/p>\n<pre><code>cd conf\nvim nginx.conf\n<\/code><\/pre>\n<p>\u5728 server \u91cc\u52a0\u5165<\/p>\n<pre><code>location ~ .php$ {\n    fastcgi_pass   127.0.0.1:9000;\n    fastcgi_index  index.php;\n    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;\n    include        fastcgi_params;\n}\n<\/code><\/pre>\n<p>\u652f\u6301 asp.net\u3002\u5728 server \u91cc\u52a0\u5165<\/p>\n<pre><code>location \/ {\n    proxy_pass http:\/\/127.0.0.1:5000;\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection keep-alive;\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_cache_bypass $http_upgrade;\n}\n<\/code><\/pre>\n<p><strong>\u9632\u706b\u5899\u6dfb\u52a0 80\u3001443 \u7aef\u53e3\uff08\u53ef\u9009\uff0c\u9700\u8981\u5916\u7f51\u8bbf\u95ee\u7684\uff09<\/strong><\/p>\n<pre><code>firewall-cmd --zone=public --add-port=80\/tcp --permanent    \/\/--permanent\u6c38\u4e45\u751f\u6548\uff0c\u6ca1\u6709\u6b64\u53c2\u6570\u91cd\u542f\u540e\u5931\u6548\nfirewall-cmd --reload \/\/\u91cd\u65b0\u8f7d\u5165\n<\/code><\/pre>\n<p><strong>nginx \u5e38\u7528\u547d\u4ee4<\/strong><\/p>\n<pre><code>ln -s \/web\/nginx\/sbin\/nginx \/usr\/local\/bin        \/\/\u5feb\u6377\u65b9\u5f0f\n\/web\/nginx\/sbin\/nginx             \/\/\u542f\u52a8nginx\n\/web\/nginx\/sbin\/nginx -s reload   \/\/\u91cd\u542fnginx\n\/web\/nginx\/sbin\/nginx -s stop     \/\/\u5173\u95ednginx<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u66f4\u65b0\u7cfb\u7edf\u5b89\u88c5\u5305\u5217\u8868 apt update \u5fc5\u987b\u8f6f\u4ef6\u5305\u4f9d\u8d56 \u4e0b\u9762\u90fd\u662f\u7f16\u8bd1 nginx \u5fc5\u987b\u7684\uff0c\u63d0\u524d\u5b89\u88c5\u597d\u3002 ap [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[35,39],"topics":[],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-jc","tag-debian","tag-nginx"],"_links":{"self":[{"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/comments?post=83"}],"version-history":[{"count":1,"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/posts\/83\/revisions\/96"}],"wp:attachment":[{"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/media?parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/categories?post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/tags?post=83"},{"taxonomy":"topics","embeddable":true,"href":"https:\/\/www.meblg.com\/index.php\/wp-json\/wp\/v2\/topics?post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}