{"id":177,"date":"2013-12-26T08:00:00","date_gmt":"2013-12-26T00:00:00","guid":{"rendered":"http:\/\/31.0.2.219:81\/?p=177"},"modified":"2016-12-22T11:29:58","modified_gmt":"2016-12-22T03:29:58","slug":"apache-%e9%85%8d%e7%bd%ae%e5%a4%9a%e5%9f%9f%e5%90%8d","status":"publish","type":"post","link":"http:\/\/www.huike007.cn\/?p=177","title":{"rendered":"apache \u914d\u7f6e\u591a\u57df\u540d"},"content":{"rendered":"<p>\u9700\u8981\u6dfb\u52a0\u865a\u62df\u4e3b\u673a\uff0c\u914d\u7f6e\u6587\u4ef6\u5e94\u8be5\u662f apache\u76ee\u5f55\/conf\/extra\/httpd-vhosts.conf\uff0c\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u6709\u793a\u4f8b\uff0c\u7167\u7740\u914d\u4e00\u4e0b\u5373\u53ef,\u4ee5\u4e0b\u4e3a\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u6709\u4ee5\u4e0b\u51e0\u9879\u7684\u7b80\u5355\u914d\u7f6e\u5c31\u53ef\u4ee5\u8fd0\u884c\u4e86\uff0c\u5982\u679c\u9700\u8981\u522b\u540d\u3001rewrite\u90fd\u53ef\u4ee5\u52a0\u5728\u91cc\u8fb9\uff0c&lt;VirtualHost *:80&gt; ServerAdmin admin@abc.com DocumentRoot &#8220;\/home\/xyz\/htdocs&#8221; ServerName xyz.abc.com &lt;Directory &#8220;\/home\/xyz\/htdocs&#8221;&gt; Options Indexes FollowSymLinks AllowOverride None order allow,deny Allow from all &lt;\/Directory&gt;&lt;\/VirtualHost&gt;\u7136\u540e\u5728httpd.conf\u4e2d\u628a\u8fd9\u4e2a\u6587\u4ef6\u8f7d\u5165\uff1aInclude conf\/extra\/httpd-vhosts.conf<br \/>\n&nbsp;<br \/>\nServerName 192.168.1.1<br \/>\nOrder Allow,Deny<br \/>\nDeny from all<br \/>\nDocumentRoot \u201cD:\\web\\\u201d<br \/>\nServerName <a href=\"http:\/\/www.baidu.com\/\" rel=\"nofollow\"><span style=\"color: #0073aa;\">http:\/\/www.baidu.com<\/span><\/a><br \/>\nOptions FollowSymLinks ExecCGI<br \/>\nAllowOverride All<br \/>\nOrder allow,deny<br \/>\nAllow from all<br \/>\nRequire all granted<br \/>\n\u524d\u9762\u52a0\u4e2aIP\u62d2\u7edd\u8bbf\u95ee\uff0c\u5c31\u53ea\u5141\u8bb8\u7528\u57df\u540d\u8bbf\u95ee\u3002<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\nServerName 192.168.1.1<br \/>\nOrder Allow,Deny<br \/>\nDeny from all<br \/>\nDocumentRoot \u201cD:\\web\\\u201d<br \/>\nServerName <a href=\"http:\/\/www.baidu.com\/\" rel=\"nofollow\"><span style=\"color: #000080;\">http:\/\/www.baidu.com<\/span><\/a><br \/>\nOptions FollowSymLinks ExecCGI<br \/>\nAllowOverride All<br \/>\nOrder allow,deny<br \/>\nAllow from all<br \/>\nRequire all granted<br \/>\n\u524d\u9762\u52a0\u4e2aIP\u62d2\u7edd\u8bbf\u95ee\uff0c\u5c31\u53ea\u5141\u8bb8\u7528\u57df\u540d\u8bbf\u95ee\u3002<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n\u82e5\u8bbf\u95ee\u51fa\u73b0403\u9519\u8bef\uff0c<br \/>\n\u6dfb\u52a0\u7ea2\u8272\u90e8\u5206\u5373\u53ef\u3002<br \/>\n&lt;VirtualHost *:80&gt;<br \/>\nServerAdmin webmaster@dummy-host2.example.com<br \/>\nDocumentRoot &#8220;D:\/www&#8221;<br \/>\nServerName?www.abc.com<br \/>\nErrorLog &#8220;logs\/dummy-host2.example.com-error.log&#8221;<br \/>\nCustomLog &#8220;D:\/wamp\/logs\/access.log&#8221; common<br \/>\n<strong><span style=\"color: #ff0000;\">&lt;Directory &#8220;D:\/www&#8221;&gt;<\/span><\/strong><br \/>\n<strong><span style=\"color: #ff0000;\">Options FollowSymLinks<\/span><\/strong><br \/>\n<strong><span style=\"color: #ff0000;\">AllowOverride None<\/span><\/strong><br \/>\n<strong><span style=\"color: #ff0000;\">Order deny,allow<\/span><\/strong><br \/>\n<strong><span style=\"color: #ff0000;\">Require all granted<\/span><\/strong><br \/>\n<strong><span style=\"color: #ff0000;\">&lt;\/Directory&gt;<\/span><\/strong><br \/>\n&lt;\/VirtualHost&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9700\u8981\u6dfb\u52a0\u865a\u62df\u4e3b\u673a\uff0c\u914d\u7f6e\u6587\u4ef6\u5e94\u8be5\u662f apache\u76ee\u5f55\/conf\/extra\/httpd-vhosts.conf\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[178],"tags":[241,275],"_links":{"self":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/177"}],"collection":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=177"}],"version-history":[{"count":5,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":491,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/177\/revisions\/491"}],"wp:attachment":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}