首页 > Web开发 > 详细

Apache 配置虚拟目录和虚拟主机

时间:2014-12-13 23:10:34      阅读:390      评论:0      收藏:0      [点我收藏+]

Apache配置虚拟目录

在httpd.conf文件中添加 大约在245行

# Create Virtual catalogue
<IfModule dir_module>
    DirectoryIndex index.html index.htm index.php
    Alias /MyWeb "c:/MyWeb" // 在C盘的根目录下有一个Myweb文件夹,可以把这个文件夹看做虚拟目录
    <Directory c:/MyWeb>
        Order allow,deny
        Allow from all
    </Directory>
</IfModule>

 

Apache配置虚拟主机

在httpd文件中打开Virtual Host 大约在480行

# Virtual hosts 配置虚拟主机
Include conf/extra/httpd-vhosts.conf

 

接下来修改conf/extra/httpd-vhosts.conf文件

在最后一行添加

#配置自己的虚拟主机
<VirtualHost 127.0.0.1:80>
    DocumentRoot "C:/MyWeb"
    DirectoryIndex index.html index.htm index.php
    <Directory C:/MyWeb>
    Options FollowSymLinks
    #Not allow others to correct our page
    AllowOverride None
    #set 
    Order allow, deny
    Allow from all
    </Directory>
</VirtualHost>

 

Apache 配置虚拟目录和虚拟主机

原文:http://www.cnblogs.com/xiaoshanshan/p/4161980.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!