{"id":54197,"date":"2024-10-09T17:32:13","date_gmt":"2024-10-09T09:32:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/54197\/"},"modified":"2024-10-09T17:32:14","modified_gmt":"2024-10-09T09:32:14","slug":"windows-2003-%e4%b8%8b-apache-%e9%85%8d%e7%bd%ae%e8%99%9b%e6%93%ac%e4%b8%bb%e6%a9%9f%e5%92%8c%e7%b6%81%e5%ae%9a%e5%9f%9f%e5%90%8d%e6%9c%8d%e5%8b%99-2","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/54197\/","title":{"rendered":"Windows 2003 \u4e0b Apache \u914d\u7f6e\u865b\u64ec\u4e3b\u6a5f\u548c\u7d81\u5b9a\u57df\u540d\u670d\u52d9"},"content":{"rendered":"<h1 id=\"windows-2003-%e4%b8%8b-apache-%e9%85%8d%e7%bd%ae%e8%99%9b%e6%93%ac%e4%b8%bb%e6%a9%9f%e5%92%8c%e7%b6%81%e5%ae%9a%e5%9f%9f%e5%90%8d%e6%9c%8d%e5%8b%99-bhrShKsQnZ\">Windows 2003 \u4e0b Apache \u914d\u7f6e\u865b\u64ec\u4e3b\u6a5f\u548c\u7d81\u5b9a\u57df\u540d\u670d\u52d9<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u865b\u64ec\u4e3b\u6a5f\u7684\u4f7f\u7528\u8d8a\u4f86\u8d8a\u666e\u904d\u3002\u5c0d\u65bc\u4f7f\u7528 Windows 2003 \u4f5c\u696d\u7cfb\u7d71\u7684\u4f3a\u670d\u5668\u4f86\u8aaa\uff0cApache \u662f\u4e00\u500b\u975e\u5e38\u53d7\u6b61\u8fce\u7684\u7db2\u9801\u4f3a\u670d\u5668\u9078\u64c7\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 Windows 2003 \u4e0b\u914d\u7f6e Apache \u865b\u64ec\u4e3b\u6a5f\u53ca\u7d81\u5b9a\u57df\u540d\u670d\u52d9\uff0c\u5e6b\u52a9\u7528\u6236\u66f4\u6709\u6548\u5730\u7ba1\u7406\u5176\u7db2\u7ad9\u3002<\/p>\n<h2 id=\"apache-%e5%ae%89%e8%a3%9d%e8%88%87%e5%9f%ba%e6%9c%ac%e9%85%8d%e7%bd%ae-bhrShKsQnZ\">Apache \u5b89\u88dd\u8207\u57fa\u672c\u914d\u7f6e<\/h2>\n<p>\u9996\u5148\uff0c\u78ba\u4fdd\u5df2\u7d93\u5728 Windows 2003 \u4e0a\u5b89\u88dd\u4e86 Apache\u3002\u53ef\u4ee5\u5f9e Apache \u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09\u9069\u5408 Windows \u7684\u5b89\u88dd\u5305\uff0c\u4e26\u6309\u7167\u5b89\u88dd\u5411\u5c0e\u9032\u884c\u5b89\u88dd\u3002\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u901a\u5e38 Apache \u7684\u914d\u7f6e\u6587\u4ef6\u4f4d\u65bc <code>C:Program FilesApache GroupApache2confhttpd.conf<\/code>\u3002<\/p>\n<h3 id=\"%e7%b7%a8%e8%bc%af%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6-bhrShKsQnZ\">\u7de8\u8f2f\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u6253\u958b <code>httpd.conf<\/code> \u6587\u4ef6\uff0c\u9032\u884c\u4ee5\u4e0b\u57fa\u672c\u914d\u7f6e\uff1a<\/p>\n<ul>\n<li>\u8a2d\u7f6e\u4f3a\u670d\u5668\u6839\u76ee\u9304\uff1a<\/li>\n<pre><code>DocumentRoot \"C:\/www\"<\/code><\/pre>\n<li>\u8a2d\u7f6e\u4f3a\u670d\u5668\u540d\u7a31\uff1a<\/li>\n<pre><code>ServerName localhost:80<\/code><\/pre>\n<\/ul>\n<h2 id=\"%e9%85%8d%e7%bd%ae%e8%99%9b%e6%93%ac%e4%b8%bb%e6%a9%9f-bhrShKsQnZ\">\u914d\u7f6e\u865b\u64ec\u4e3b\u6a5f<\/h2>\n<p>\u865b\u64ec\u4e3b\u6a5f\u5141\u8a31\u5728\u540c\u4e00\u53f0\u4f3a\u670d\u5668\u4e0a\u904b\u884c\u591a\u500b\u7db2\u7ad9\u3002\u8981\u914d\u7f6e\u865b\u64ec\u4e3b\u6a5f\uff0c\u9996\u5148\u9700\u8981\u5728 <code>httpd.conf<\/code> \u6587\u4ef6\u4e2d\u555f\u7528\u865b\u64ec\u4e3b\u6a5f\u6a21\u7d44\uff1a<\/p>\n<pre><code>LoadModule vhost_alias_module modules\/mod_vhost_alias.so<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u6dfb\u52a0\u865b\u64ec\u4e3b\u6a5f\u7684\u914d\u7f6e\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u865b\u64ec\u4e3b\u6a5f\u7684\u7bc4\u4f8b\uff1a<\/p>\n<pre><code>&lt;VirtualHost *:80&gt;\n    ServerAdmin webmaster@domain1.com\n    DocumentRoot \"C:\/www\/domain1\"\n    ServerName domain1.com\n    ServerAlias www.domain1.com\n    ErrorLog \"logs\/domain1-error.log\"\n    CustomLog \"logs\/domain1-access.log\" common\n&lt;\/VirtualHost&gt;\n\n&lt;VirtualHost *:80&gt;\n    ServerAdmin webmaster@domain2.com\n    DocumentRoot \"C:\/www\/domain2\"\n    ServerName domain2.com\n    ServerAlias www.domain2.com\n    ErrorLog \"logs\/domain2-error.log\"\n    CustomLog \"logs\/domain2-access.log\" common\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n<p>\u5728\u4e0a\u8ff0\u7bc4\u4f8b\u4e2d\uff0c<code>DocumentRoot<\/code> \u6307\u5b9a\u4e86\u7db2\u7ad9\u7684\u6839\u76ee\u9304\uff0c\u800c <code>ServerName<\/code> \u548c <code>ServerAlias<\/code> \u5247\u7528\u65bc\u7d81\u5b9a\u57df\u540d\u3002<\/p>\n<h2 id=\"%e7%b6%81%e5%ae%9a%e5%9f%9f%e5%90%8d%e6%9c%8d%e5%8b%99-bhrShKsQnZ\">\u7d81\u5b9a\u57df\u540d\u670d\u52d9<\/h2>\n<p>\u70ba\u4e86\u4f7f\u865b\u64ec\u4e3b\u6a5f\u80fd\u5920\u6b63\u78ba\u904b\u884c\uff0c\u5fc5\u9808\u78ba\u4fdd\u57df\u540d\u6307\u5411\u4f3a\u670d\u5668\u7684 IP \u5730\u5740\u3002\u9019\u901a\u5e38\u901a\u904e DNS \u8a2d\u7f6e\u4f86\u5b8c\u6210\u3002\u7528\u6236\u9700\u8981\u5728\u57df\u540d\u8a3b\u518a\u5546\u7684\u63a7\u5236\u9762\u677f\u4e2d\u6dfb\u52a0 A \u8a18\u9304\uff0c\u5c07\u57df\u540d\u6307\u5411\u4f3a\u670d\u5668\u7684 IP \u5730\u5740\u3002<\/p>\n<h3 id=\"%e6%aa%a2%e6%9f%a5%e9%85%8d%e7%bd%ae-bhrShKsQnZ\">\u6aa2\u67e5\u914d\u7f6e<\/h3>\n<p>\u5b8c\u6210\u914d\u7f6e\u5f8c\uff0c\u91cd\u555f Apache \u4f3a\u670d\u5668\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u91cd\u555f Apache\uff1a<\/p>\n<pre><code>httpd -k restart<\/code><\/pre>\n<p>\u63a5\u8457\uff0c\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f\u7d81\u5b9a\u7684\u57df\u540d\uff0c\u6aa2\u67e5\u662f\u5426\u80fd\u5920\u6b63\u78ba\u986f\u793a\u5c0d\u61c9\u7684\u7db2\u7ad9\u5167\u5bb9\u3002\u5982\u679c\u4e00\u5207\u6b63\u5e38\uff0c\u5247\u8868\u793a\u865b\u64ec\u4e3b\u6a5f\u548c\u57df\u540d\u7d81\u5b9a\u914d\u7f6e\u6210\u529f\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-bhrShKsQnZ\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Windows 2003 \u4e0b\u914d\u7f6e Apache \u865b\u64ec\u4e3b\u6a5f\u548c\u7d81\u5b9a\u57df\u540d\u670d\u52d9\u662f\u4e00\u500b\u76f8\u5c0d\u7c21\u55ae\u7684\u904e\u7a0b\uff0c\u53ea\u9700\u6309\u7167\u4e0a\u8ff0\u6b65\u9a5f\u9032\u884c\u8a2d\u7f6e\u5373\u53ef\u3002\u9019\u4e0d\u50c5\u80fd\u5920\u63d0\u9ad8\u4f3a\u670d\u5668\u7684\u8cc7\u6e90\u5229\u7528\u7387\uff0c\u9084\u80fd\u5920\u70ba\u7528\u6236\u63d0\u4f9b\u66f4\u9748\u6d3b\u7684\u7db2\u7ad9\u7ba1\u7406\u65b9\u5f0f\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u6eff\u8db3\u4e0d\u540c\u7528\u6236\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to configure virtual hosts and bind domain services on Apache for Windows 2003, ensuring efficient web server management.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-54197","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=54197"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54197\/revisions"}],"predecessor-version":[{"id":54198,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54197\/revisions\/54198"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=54197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=54197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=54197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}