{"id":63600,"date":"2025-04-29T10:54:18","date_gmt":"2025-04-29T02:54:18","guid":{"rendered":"https:\/\/fwq.ai\/blog\/63600\/"},"modified":"2025-04-29T10:54:18","modified_gmt":"2025-04-29T02:54:18","slug":"apache%e6%80%8e%e4%b9%88%e5%88%a0%e9%99%a4%e5%a4%9a%e4%ba%8e%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%90%8d-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/63600\/","title":{"rendered":"apache\u600e\u4e48\u5220\u9664\u591a\u4e8e\u7684\u670d\u52a1\u5668\u540d"},"content":{"rendered":"<blockquote><p>\n  \u8981\u4ece apache \u4e2d\u5220\u9664\u591a\u4f59\u7684 servername \u6307\u4ee4\uff0c\u53ef\u4ee5\u91c7\u53d6\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u8bc6\u522b\u5e76\u5220\u9664\u591a\u4f59\u7684 servername \u6307\u4ee4\u3002\u91cd\u65b0\u542f\u52a8 apache \u4f7f\u66f4\u6539\u751f\u6548\u3002\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u9a8c\u8bc1\u66f4\u6539\u3002\u6d4b\u8bd5\u670d\u52a1\u5668\u786e\u4fdd\u95ee\u9898\u5df2\u89e3\u51b3\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/29\/2024052918003190426.jpg\" class=\"aligncenter\" title=\"apache\u600e\u4e48\u5220\u9664\u591a\u4e8e\u7684\u670d\u52a1\u5668\u540d\u63d2\u56fe\" alt=\"apache\u600e\u4e48\u5220\u9664\u591a\u4e8e\u7684\u670d\u52a1\u5668\u540d\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4ece Apache \u4e2d\u5220\u9664\u591a\u4f59\u7684 ServerName \u6307\u4ee4<\/strong><\/p>\n<p>Apache \u4e2d\u7684\u591a\u4f59 ServerName \u6307\u4ee4\u53ef\u80fd\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u9519\u8bef\u6216\u914d\u7f6e\u95ee\u9898\u3002\u8981\u5220\u9664\u8fd9\u4e9b\u591a\u4f59\u7684\u6307\u4ee4\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<p><strong>1. \u8bc6\u522b\u591a\u4f59\u7684 ServerName \u6307\u4ee4<\/strong><\/p>\n<p>\u6253\u5f00 Apache \u914d\u7f6e\u6587\u4ef6\uff08\u901a\u5e38\u662f \/etc\/2\/apache2.conf \u6216 \/etc\/httpd\/conf\/httpd.conf\uff09\u3002\u641c\u7d22 ServerName \u6307\u4ee4\uff0c\u5e76\u786e\u5b9a\u8981\u5220\u9664\u7684\u591a\u4f59\u6307\u4ee4\u3002<\/p>\n<p><strong>2. \u5220\u9664\u591a\u4f59\u7684\u6307\u4ee4<\/strong><\/p>\n<p>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6216\u547d\u4ee4\u884c\u5de5\u5177\u5220\u9664\u591a\u4f59\u7684 ServerName \u6307\u4ee4\u3002\u786e\u4fdd\u53ea\u5220\u9664\u591a\u4f59\u7684\u6307\u4ee4\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<p><strong>3. \u91cd\u65b0\u542f\u52a8 Apache<\/strong><\/p>\n<p>\u5bf9\u914d\u7f6e\u8fdb\u884c\u66f4\u6539\u540e\uff0c\u5fc5\u987b\u91cd\u65b0\u542f\u52a8 Apache \u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u91cd\u65b0\u542f\u52a8 Apache\uff1a<\/p>\n<ul>\n<li>Ubuntu\/Debian\uff1asudo systemctl restart apache2<\/li>\n<li>CentOS\/Red Hat\uff1asudo systemctl restart httpd<\/li>\n<li>macOS\uff1asudo apachectl restart<\/li>\n<\/ul>\n<p><strong>4. \u9a8c\u8bc1\u66f4\u6539<\/strong><\/p>\n<p>\u91cd\u65b0\u542f\u52a8 Apache \u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u66f4\u6539\uff1a<\/p>\n<pre>grep -i \"servername\" \/etc\/apache2\/apache2.conf<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5e94\u4ec5\u663e\u793a\u5f53\u524d\u4f7f\u7528\u7684 ServerName \u6307\u4ee4\u3002<\/p>\n<p><strong>5. \u6d4b\u8bd5\u670d\u52a1\u5668<\/strong><\/p>\n<p>\u8bbf\u95ee\u7f51\u7ad9\u4ee5\u6d4b\u8bd5\u66f4\u6539\u3002\u5982\u679c\u60a8\u4e4b\u524d\u9047\u5230\u670d\u52a1\u5668\u9519\u8bef\u6216\u914d\u7f6e\u95ee\u9898\uff0c\u8fd9\u4e9b\u95ee\u9898\u73b0\u5728\u5e94\u8be5\u5df2\u89e3\u51b3\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5220\u9664\u591a\u4e8e\u7684\u670d\u52a1\u5668\u540d\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u4ece apache \u4e2d\u5220\u9664\u591a\u4f59\u7684 servername \u6307\u4ee4\uff0c\u53ef\u4ee5\u91c7\u53d6\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u8bc6\u522b\u5e76\u5220\u9664\u591a\u4f59\u7684 servername \u6307\u4ee4\u3002\u91cd\u65b0\u542f\u52a8 apache \u4f7f\u66f4\u6539\u751f\u6548\u3002\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u9a8c\u8bc1\u66f4\u6539\u3002\u6d4b\u8bd5\u670d\u52a1\u5668\u786e\u4fdd\u95ee\u9898\u5df2\u89e3\u51b3\u3002 \u5982\u4f55\u4ece Apache \u4e2d\u5220\u9664\u591a\u4f59\u7684 ServerName \u6307\u4ee4 Apache \u4e2d\u7684\u591a\u4f59 ServerName \u6307\u4ee4\u53ef\u80fd\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u9519\u8bef\u6216\u914d\u7f6e\u95ee\u9898\u3002\u8981\u5220\u9664\u8fd9\u4e9b\u591a\u4f59\u7684\u6307\u4ee4\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a 1. \u8bc6\u522b\u591a\u4f59\u7684 ServerName \u6307\u4ee4 \u6253\u5f00 Apache \u914d\u7f6e\u6587\u4ef6\uff08\u901a\u5e38\u662f \/etc\/2\/apache2.conf \u6216 \/etc\/httpd\/conf\/httpd.conf\uff09\u3002\u641c\u7d22 ServerName \u6307\u4ee4\uff0c\u5e76\u786e\u5b9a\u8981\u5220\u9664\u7684\u591a\u4f59\u6307\u4ee4\u3002 2. \u5220\u9664\u591a\u4f59\u7684\u6307\u4ee4 \u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6216\u547d\u4ee4\u884c\u5de5\u5177\u5220\u9664\u591a\u4f59\u7684 ServerName \u6307\u4ee4\u3002\u786e\u4fdd\u53ea\u5220\u9664\u591a\u4f59\u7684\u6307\u4ee4\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u6b63\u5e38\u8fd0\u884c\u3002 3. \u91cd\u65b0\u542f\u52a8 Apache \u5bf9\u914d\u7f6e\u8fdb\u884c\u66f4\u6539\u540e\uff0c\u5fc5\u987b\u91cd\u65b0\u542f\u52a8 Apache \u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u91cd\u65b0\u542f\u52a8 Apache\uff1a Ubuntu\/Debian\uff1asudo systemctl restart apache2 CentOS\/Red Hat\uff1asudo systemctl restart httpd macOS\uff1asudo apachectl restart 4. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-63600","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=63600"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63600\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=63600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=63600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=63600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}