\u8bbe\u7f6e\u57df\u540d\u6620\u5c04\u540c\u4e00\u4e2aIP\uff0c\u4fee\u6539hosts\uff1a<\/p>\n
127.0.0.1 gm.998gx.com\r\n127.0.0.1 www.998gx.com\r\n127.0.0.1 r.998gx.com\r\n127.0.0.1 localhost<\/pre>\n\u8ddf\u4e0a\u9762\u4e00\u6837\uff0c\u5efa\u7acb\u865a\u62df\u4e3b\u673a\u5b58\u653e\u7f51\u9875\u7684\u6839\u76ee\u5f55<\/p>\n
\/www\/dxGM\/index.php\r\n\/www\/dxskadmin\/index.php\r\n\/www\/88qp\/index.php<\/pre>\n\u5728httpd.conf\u4e2d\u5c06\u9644\u52a0\u914d\u7f6e\u6587\u4ef6httpd-vhosts.conf\u5305\u542b\u8fdb\u6765\uff0c\u63a5\u7740\u5728httpd-vhosts.conf\u4e2d\u5199\u5165\u5982\u4e0b\u914d\u7f6e\uff1a<\/p>\n
\u4e3a\u4e86\u4f7f\u7528\u57fa\u4e8e\u57df\u540d\u7684\u865a\u62df\u4e3b\u673a\uff0c\u5fc5\u987b\u6307\u5b9a\u670d\u52a1\u5668IP\u5730\u5740\uff08\u548c\u53ef\u80fd\u7684\u7aef\u53e3\uff09\u6765\u4f7f\u4e3b\u673a\u63a5\u53d7\u8bf7\u6c42\u3002\u53ef\u4ee5\u7528NameVirtualHost\u6307\u4ee4\u6765\u8fdb\u884c\u914d\u7f6e\u3002 \u5982\u679c\u670d\u52a1\u5668\u4e0a\u6240\u6709\u7684IP\u5730\u5740\u90fd\u4f1a\u7528\u5230\uff0c \u4f60\u53ef\u4ee5\u7528*\u4f5c\u4e3aNameVirtualHost\u7684\u53c2\u6570\u3002\u5728NameVirtualHost\u6307\u4ee4\u4e2d\u6307\u660eIP\u5730\u5740\u5e76\u4e0d\u4f1a\u4f7f\u670d\u52a1\u5668\u81ea\u52a8\u4fa6\u542c\u90a3\u4e2aIP\u5730\u5740\u3002 \u8fd9\u91cc\u8bbe\u5b9a\u7684IP\u5730\u5740\u5fc5\u987b\u5bf9\u5e94\u670d\u52a1\u5668\u4e0a\u7684\u4e00\u4e2a\u7f51\u7edc\u63a5\u53e3\u3002<\/p>\n
\u4e0b\u4e00\u6b65\u5c31\u662f\u4e3a\u4f60\u5efa\u7acb\u7684\u6bcf\u4e2a\u865a\u62df\u4e3b\u673a\u8bbe\u5b9a\u914d\u7f6e\u5757\uff0c\u7684\u53c2\u6570\u4e0eNameVirtualHost\u6307\u4ee4\u7684\u53c2\u6570\u662f\u4e00\u6837\u7684\u3002\u6bcf\u4e2a\u5b9a\u4e49\u5757\u4e2d\uff0c\u81f3\u5c11\u90fd\u4f1a\u6709\u4e00\u4e2aServerName\u6307\u4ee4\u6765\u6307\u5b9a\u4f3a\u670d\u54ea\u4e2a\u4e3b\u673a\u548c\u4e00\u4e2aDocumentRoot\u6307\u4ee4\u6765\u8bf4\u660e\u8fd9\u4e2a\u4e3b\u673a\u7684\u5185\u5bb9\u5b58\u5728\u4e8e\u6587\u4ef6\u7cfb\u7edf\u7684\u4ec0\u4e48\u5730\u65b9\u3002<\/p>\n
\u5982\u679c\u5728\u73b0\u6709\u7684web\u670d\u52a1\u5668\u4e0a\u589e\u52a0\u865a\u62df\u4e3b\u673a\uff0c\u5fc5\u987b\u4e5f\u4e3a\u73b0\u5b58\u7684\u4e3b\u673a\u5efa\u9020\u4e00\u4e2a\u5b9a\u4e49\u5757\u3002\u5176\u4e2dServerName\u548cDocumentRoot\u6240\u5305\u542b\u7684\u5185\u5bb9\u5e94\u8be5\u4e0e\u5168\u5c40\u7684\u4fdd\u6301\u4e00\u81f4\uff0c\u4e14\u8981\u653e\u5728\u914d\u7f6e\u6587\u4ef6\u7684\u6700\u524d\u9762\uff0c\u626e\u6f14\u9ed8\u8ba4\u4e3b\u673a\u7684\u89d2\u8272\u3002<\/p>\n
< VirtualHost *:80> \r\n DocumentRoot \"D:\/phpstudy\/WWW\/dxGM\" \r\n ServerName gm.998gx.com \r\n< \/VirtualHost>\r\n \r\n< VirtualHost *:80> \r\n DocumentRoot \"D:\/phpstudy\/WWW\/88qp\" \r\n ServerName www.998gx.com \r\n< \/VirtualHost>\r\n \r\n< VirtualHost *:80> \r\n DocumentRoot \"D:\/phpstudy\/WWW\/dxskadmin\" \r\n ServerName r.998gx.com \r\n< \/VirtualHost>\r\n \r\n< VirtualHost *:80> \r\n DocumentRoot \"D:\/phpstudy\/WWW\" \r\n ServerName localhost \r\n< \/VirtualHost><\/pre>\n4. \u5927\u529f\u544a\u6210\uff0c\u6d4b\u8bd5\u4e0b\u6bcf\u4e2a\u865a\u62df\u4e3b\u673a\uff0c\u5206\u522b\u8bbf\u95eegm.998gx.com\u3001www.998gx.com\u3001r.998gx.com<\/p>\n
\u4e09\u3001\u57fa\u4e8e\u7aef\u53e3<\/strong><\/div>\n\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/p>\n
\u5c06\u539f\u6765\u7684\r\nListen 80\r\n\u6539\u4e3a\r\nListen 80\r\nListen 8080<\/pre>\n\u66f4\u6539\u865a\u62df\u4e3b\u673a\u8bbe\u7f6e\uff1a<\/p>\n
< VirtualHost 192.168.1.10:80>\r\n DocumentRoot \/var\/www\/test1\/\r\n ServerName www.test1.com\r\n< \/VirtualHost>\r\n \r\n< VirtualHost 192.168.1.10:8080>\r\n DocumentRoot \/var\/www\/test2\r\n ServerName www.test2.com\r\n< \/VirtualHost><\/pre>\n\u5230\u6b64\u8fd9\u7bc7\u5173\u4e8eapache\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u7684\u4e09\u79cd\u65b9\u5f0f(\u5c0f\u7ed3)\u7684\u6587\u7ae0\u5c31\u4ecb\u7ecd\u5230\u8fd9\u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"
\u8bb0\u4e8b\u672c\u6253\u5f00httpd.conf\u6587\u4ef6 \uff0c\u8be5\u6587\u4ef6\u5728apache\u7684\u76ee\u5f55\u4e0b\uff0c\u5982\uff1a D:\\AppServ\\Apache2 […]<\/p>\n","protected":false},"author":668,"featured_media":85652,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-248900","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/248900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=248900"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/248900\/revisions"}],"predecessor-version":[{"id":248906,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/248900\/revisions\/248906"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/85652"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=248900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=248900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=248900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}