{"id":107,"date":"2026-02-13T23:26:34","date_gmt":"2026-02-13T15:26:34","guid":{"rendered":"http:\/\/47.104.68.194\/?p=107"},"modified":"2026-02-13T23:26:34","modified_gmt":"2026-02-13T15:26:34","slug":"%e5%ae%89%e8%a3%85-apache2-%e7%9b%b4%e6%8e%a5%e5%ae%89%e8%a3%85%e5%88%ab%e7%9a%84%e7%ab%af%e5%8f%a3","status":"publish","type":"post","link":"http:\/\/47.104.68.194\/?p=107","title":{"rendered":"\u5b89\u88c5 apache2 \u76f4\u63a5\u5b89\u88c5\u522b\u7684\u7aef\u53e3"},"content":{"rendered":"\n<p>\u5728\u5b89\u88c5Apache2\u65f6\u76f4\u63a5\u4f7f\u7528\u975e\u6807\u51c6\u7aef\u53e3\uff0c\u9700\u5728\u5b89\u88c5\u540e\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u3002\u5728Linux\u4e0a\uff0c\u4f7f\u7528<\/p>\n\n\n\n<p><code>sudo apt install apache2<\/code>(Ubuntu\/Debian)\u5b89\u88c5\uff0c\u7136\u540e\u7f16\u8f91<\/p>\n\n\n\n<p><code>\/etc\/apache2\/ports.conf<\/code>\u6587\u4ef6\uff0c\u5c06<\/p>\n\n\n\n<p><code>Listen 80<\/code>\u4fee\u6539\u4e3a<\/p>\n\n\n\n<p><code>Listen 8080<\/code>(\u6216\u60a8\u9700\u8981\u7684\u7aef\u53e3)\uff0c\u7136\u540e\u66f4\u65b0\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n<p><code>\/etc\/apache2\/sites-enabled\/000-default.conf<\/code>\uff0c\u7136\u540e<\/p>\n\n\n\n<p><code>&lt;VirtualHost *:80&gt;<\/code>\u66f4\u6539\u4e3a<\/p>\n\n\n\n<p><code>&lt;VirtualHost *:8080&gt;<\/code>\uff0c\u6700\u540e\u91cd\u542f\u670d\u52a1<\/p>\n\n\n\n<p><code>sudo service apache2 restart<\/code>\u3002<\/p>\n\n\n\n<p><strong>\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5b89\u88c5\u963f\u5e15\u59472<\/strong>\u72c2\u6b22<code>sudo apt update sudo apt install apache2<\/code><\/li>\n\n\n\n<li><strong>\u4fee\u6539\u7aef\u53e3\u76d1\u542c\u914d\u7f6e\u6587\u4ef6<\/strong><br>\u7f16\u8f91<code>\/etc\/apache2\/ports.conf<\/code>\uff1a\u72c2\u6b22<code>sudo nano \/etc\/apache2\/ports.conf <\/code>\u5c06<code>Listen 80<\/code>\u4fee\u6539\u4e3a\u4f8b\u5982<code>Listen 8080<\/code>\u3002<\/li>\n\n\n\n<li><strong>\u4fee\u6539\u865a\u62df\u4e3b\u673a\u914d\u7f6e<\/strong><br>\u7f16\u8f91<code>\/etc\/apache2\/sites-enabled\/000-default.conf<\/code>\uff1a\u72c2\u6b22<code>sudo nano \/etc\/apache2\/sites-enabled\/000-default.conf <\/code>\u5c06\u7b2c\u4e00\u884c<code>&lt;VirtualHost *:80><\/code>\u4fee\u6539\u4e3a<code>&lt;VirtualHost *:8080><\/code>\u3002<\/li>\n\n\n\n<li><strong>\u91cd\u65b0\u542f\u52a8 Apache \u670d\u52a1<\/strong>\u72c2\u6b22<code>sudo service apache2 restart <\/code>\u00a0<\/li>\n<\/ol>\n\n\n\n<p>\u6ce8\u610f\uff1a\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u9632\u706b\u5899\uff08\u5982<\/p>\n\n\n\n<p><code>ufw<\/code>\uff09\uff0c\u9700\u8981\u5141\u8bb8\u65b0\u7684\u7aef\u53e3\uff1a<\/p>\n\n\n\n<p><code>sudo ufw allow 8080\/tcp<\/code>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5b89\u88c5Apache2\u65f6\u76f4\u63a5\u4f7f\u7528\u975e\u6807\u51c6\u7aef\u53e3\uff0c\u9700\u5728\u5b89\u88c5\u540e\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u3002\u5728Linux\u4e0a\uff0c\u4f7f\u7528 sudo apt in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/47.104.68.194\/index.php?rest_route=\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/47.104.68.194\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/47.104.68.194\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/47.104.68.194\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/47.104.68.194\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107"}],"version-history":[{"count":1,"href":"http:\/\/47.104.68.194\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":108,"href":"http:\/\/47.104.68.194\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions\/108"}],"wp:attachment":[{"href":"http:\/\/47.104.68.194\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/47.104.68.194\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/47.104.68.194\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}