{"id":100,"date":"2021-01-08T22:57:42","date_gmt":"2021-01-08T14:57:42","guid":{"rendered":"http:\/\/www.apiworld.tech\/wordpress\/?p=100"},"modified":"2021-01-08T22:57:42","modified_gmt":"2021-01-08T14:57:42","slug":"ubuntu-sheng-ji-ruan-jian-he-an-zhuangnginx","status":"publish","type":"post","link":"http:\/\/madapapa.com\/wordpress\/?p=100","title":{"rendered":"ubuntu\u5347\u7ea7\u8f6f\u4ef6\u548c\u5b89\u88c5Nginx"},"content":{"rendered":"<h2 id=\"toc_0\">\u9996\u5148\u770b\u4e0b\u6709\u6ca1\u6709\u9700\u8981\u5347\u7ea7\u7684\u8f6f\u4ef6<\/h2>\n<pre><code class=\"language-text\"># apt list --upgradable\nListing... Done\nlinux-generic\/focal-updates 5.4.0.60.63 amd64 [upgradable from: 5.4.0.54.57]\nlinux-headers-generic\/focal-updates 5.4.0.60.63 amd64 [upgradable from: 5.4.0.54.57]\nlinux-image-generic\/focal-updates 5.4.0.60.63 amd64 [upgradable from: 5.4.0.54.57]\n<\/code><\/pre>\n<p>\u8fd8\u597d\uff0c\u521a\u624d\u5df2\u7ecf\u628a\u8f6f\u4ef6\u5305\u5347\u7ea7\u8fc7\u4e86\uff0c\u73b0\u5728\u53ea\u8981\u5347\u7ea7\u7cfb\u7edf\u5c31\u53ef\u4ee5\u3002<\/p>\n<h3 id=\"toc_1\">\u5347\u7ea7\u8f6f\u4ef6\u5305\u547d\u4ee4<\/h3>\n<pre><code class=\"language-text\">sudo apt-get update \u66f4\u65b0\u6e90\nsudo apt-get upgrade \u66f4\u65b0\u5df2\u5b89\u88c5\u7684\u5305\n<\/code><\/pre>\n<h3 id=\"toc_2\">\u5347\u7ea7\u7cfb\u7edf\u547d\u4ee4\u5982\u4e0b<\/h3>\n<pre><code class=\"language-text\">sudo apt-get dist-upgrade \u5347\u7ea7\u7cfb\u7edf\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.apiworld.tech\/wordpress\/wp-content\/uploads\/2021\/01\/16101182043538.jpg\" alt=\"\" style=\"width:576px;\"\/><\/p>\n<p>\u7136\u540e\u5728\u770b\u4e0b\uff0c\u90fd\u662f\u6700\u65b0\u7684\u4e86\u3002<\/p>\n<pre><code class=\"language-text\">#apt list --upgradable\nListing... Done\n<\/code><\/pre>\n<pre><code class=\"language-text\">root@MDaliyun ~ # sudo apt update\nHit:1 http:\/\/mirrors.cloud.aliyuncs.com\/ubuntu focal InRelease\nHit:2 http:\/\/mirrors.cloud.aliyuncs.com\/ubuntu focal-updates InRelease\nHit:3 http:\/\/mirrors.cloud.aliyuncs.com\/ubuntu focal-security InRelease\nReading package lists... Done\nBuilding dependency tree\nReading state information... Done\nAll packages are up to date.\n<\/code><\/pre>\n<h2 id=\"toc_3\">\u4e0b\u6765\u5b89\u88c5Nginx<\/h2>\n<p>\u5b89\u88c5Nginx<\/p>\n<pre><code class=\"language-text\">sudo apt install nginx\n<\/code><\/pre>\n<p>\u67e5\u770bNginx\u72b6\u6001<\/p>\n<pre><code class=\"language-text\"> sudo systemctl status nginx\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.apiworld.tech\/wordpress\/wp-content\/uploads\/2021\/01\/16101185245193.jpg\" alt=\"\" style=\"width:745px;\"\/><\/p>\n<pre><code class=\"language-text\">root@MDaliyun \/ # vi \/etc\/nginx\/nginx.conf\n<\/code><\/pre>\n<p>\u7f16\u8f91 nginx.conf \u6587\u4ef6\u3002<br \/>\n\u627e\u5230 server{&#8230;}\uff0c\u5e76\u5c06 server \u5927\u62ec\u53f7\u4e2d\u76f8\u5e94\u7684\u914d\u7f6e\u4fe1\u606f\u66ff\u6362\u4e3a\u5982\u4e0b\u5185\u5bb9\u3002\u7528\u4e8e\u53d6\u6d88\u5bf9 IPv6 \u5730\u5740\u7684\u76d1\u542c\uff0c\u540c\u65f6\u914d\u7f6e Nginx\uff0c\u5b9e\u73b0\u4e0e PHP \u7684\u8054\u52a8\u3002<\/p>\n<pre><code class=\"language-text\">server {\n listen       80;\n root   \/usr\/share\/nginx\/html;\n server_name  localhost;\n #charset koi8-r;\n #access_log  \/var\/log\/nginx\/log\/host.access.log  main;\n #\n location \/ {\n       index index.php index.html index.htm;\n }\n #error_page  404              \/404.html;\n #redirect server error pages to the static page \/50x.html\n #\n error_page   500 502 503 504  \/50x.html;\n location = \/50x.html {\n   root   \/usr\/share\/nginx\/html;\n }\n #pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\n #\n 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}\n<\/code><\/pre>\n<p>\u53c2\u8003\u6587\u6863\u5982\u4e0b<br \/>\n<a href=\"https:\/\/www.myfreax.com\/how-to-install-nginx-on-ubuntu-18-04\/\">https:\/\/www.myfreax.com\/how-to-install-nginx-on-ubuntu-18-04\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u770b\u4e0b\u6709\u6ca1\u6709\u9700\u8981\u5347\u7ea7\u7684\u8f6f\u4ef6 # apt list &#8211;upgradable Listing&#8230; Done linux-generic\/focal-updates 5.4.0.60.63 amd64 [upgradable from: 5.4.0.54.57] linux-headers-generic\/focal-updates 5.4.0.60.63 amd64 [upgradable from: 5.4.0.54.57] linux-image-generic\/focal-updates 5.4.0.60.63 amd64 [upgradable from: 5.4.0.54.57] \u8fd8\u597d\uff0c\u521a\u624d\u5df2\u7ecf\u628a\u8f6f\u4ef6\u5305\u5347\u7ea7\u8fc7\u4e86\uff0c\u73b0\u5728\u53ea\u8981\u5347\u7ea7\u7cfb\u7edf\u5c31\u53ef\u4ee5\u3002 \u5347\u7ea7\u8f6f\u4ef6\u5305\u547d\u4ee4 sudo apt-get update \u66f4\u65b0\u6e90 sudo apt-get upgrade \u66f4\u65b0\u5df2\u5b89\u88c5\u7684\u5305 \u5347\u7ea7\u7cfb\u7edf\u547d\u4ee4\u5982\u4e0b sudo apt-get dist-upgrade \u5347\u7ea7\u7cfb\u7edf \u7136\u540e\u5728\u770b\u4e0b\uff0c\u90fd\u662f\u6700\u65b0\u7684\u4e86\u3002 #apt list &#8211;upgradable Listing&#8230; Done root@MDaliyun ~ # sudo apt update Hit:1 http:\/\/mirrors.cloud.aliyuncs.com\/ubuntu focal &hellip; <a href=\"http:\/\/madapapa.com\/wordpress\/?p=100\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ubuntu\u5347\u7ea7\u8f6f\u4ef6\u548c\u5b89\u88c5Nginx<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[5,11],"tags":[14],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-linux","category-tech","tag-nginx"],"_links":{"self":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100"}],"version-history":[{"count":0,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions"}],"wp:attachment":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}