{"id":259,"date":"2021-11-11T00:07:11","date_gmt":"2021-11-10T16:07:11","guid":{"rendered":"http:\/\/madapapa.com\/wordpress\/?p=259"},"modified":"2021-11-11T00:31:36","modified_gmt":"2021-11-10T16:31:36","slug":"centos7-yu-ubantu20-mo-ren-shou-ye-de-bu-tong","status":"publish","type":"post","link":"http:\/\/madapapa.com\/wordpress\/?p=259","title":{"rendered":"CentOS7 \u4e0e Ubantu20 \u9ed8\u8ba4\u9996\u9875\u7684\u4e0d\u540c"},"content":{"rendered":"<h2><a id=\"centos7-banwagong\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>CentOS7-banwagong<\/h2>\n<p>\u9996\u5148\uff0cnginx -t\u53d1\u73b0\u6b63\u786e\u914d\u7f6e\u6587\u4ef6\u5730\u5740<\/p>\n<pre><code class=\"language-plain_text\"> [11:10]\/nginx -t    \nnginx: [warn] conflicting server name &quot;localhost&quot; on 0.0.0.0:80, ignored\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful\n<\/code><\/pre>\n<p>\u7136\u540evi nginx.conf,\u53d1\u73b0\u6839\u76ee\u5f55\u4e3a \/usr\/share\/nginx\/html,\u7f16\u8f91index.html\u5373\u53ef<\/p>\n<pre><code class=\"language-plain_text\">http {\n    include       \/etc\/nginx\/mime.types;\n    default_type  application\/octet-stream;\n\n    log_format  main  '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '\n                      '$status $body_bytes_sent &quot;$http_referer&quot; '\n                      '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;';\n\n    access_log  \/var\/log\/nginx\/access.log  main;\n\n    sendfile        on;\n    #tcp_nopush     on;\n\n    keepalive_timeout  65;\n\n    #gzip  on;\nserver {\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<\/code><\/pre>\n<h2><a id=\"ubuntu20-aliyun\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>Ubuntu20-aliyun<\/h2>\n<p>\u524d\u5e8f\u64cd\u4f5c\u548ccentos\u76f8\u4eff\uff0c\u5728nginx.conf\u4e0b\u6ca1\u6709index.html\u5185\u5bb9\uff0c\u9700\u8981\u5bf9sites-available\u4e0bdefault\u8fdb\u884c\u7f16\u8f91<\/p>\n<pre><code class=\"language-plain_text\">\/etc\/nginx\/sites-available\n # vi default\n<\/code><\/pre>\n<pre><code class=\"language-plain_text\">server {\n        listen 80 default_server;\n        listen [::]:80 default_server;\n\n        # SSL configuration\n        #\n        # listen 443 ssl default_server;\n        # listen [::]:443 ssl default_server;\n        #\n        # Note: You should disable gzip for SSL traffic.\n        # See: https:\/\/bugs.debian.org\/773332\n        #\n        # Read up on ssl_ciphers to ensure a secure configuration.\n        # See: https:\/\/bugs.debian.org\/765782\n        #\n        # Self signed certs generated by the ssl-cert package\n        # Don't use them in a production server!\n        #\n        # include snippets\/snakeoil.conf;\n\n        root \/var\/www\/html;\n\n        # Add index.php to the list if you are using PHP\n        index index.php index.html index.htm index.nginx-debian.html;\n\n        server_name _;\n<\/code><\/pre>\n<p><a href=\"https:\/\/www.cnblogs.com\/loseself\/p\/8888009.html\">ubuntu nginx\u914d\u7f6e\u53c2\u8003<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS7-banwagong \u9996\u5148\uff0cnginx -t\u53d1\u73b0\u6b63\u786e\u914d\u7f6e\u6587\u4ef6\u5730\u5740 [11:10]\/nginx -t nginx: [warn] conflicting server name &quot;localhost&quot; on 0.0.0.0:80, ignored nginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok nginx: configuration file \/etc\/nginx\/nginx.conf test is successful \u7136\u540evi nginx.conf,\u53d1\u73b0\u6839\u76ee\u5f55\u4e3a \/usr\/share\/nginx\/html,\u7f16\u8f91index.html\u5373\u53ef http { include \/etc\/nginx\/mime.types; default_type application\/octet-stream; log_format main &#8216;$remote_addr &#8211; $remote_user [$time_local] &quot;$request&quot; &#8216; &#8216;$status $body_bytes_sent &quot;$http_referer&quot; &#8216; &#8216;&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;&#8217;; access_log \/var\/log\/nginx\/access.log main; &hellip; <a href=\"http:\/\/madapapa.com\/wordpress\/?p=259\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">CentOS7 \u4e0e Ubantu20 \u9ed8\u8ba4\u9996\u9875\u7684\u4e0d\u540c<\/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],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/259","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=259"}],"version-history":[{"count":3,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":262,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions\/262"}],"wp:attachment":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}