码迷,mamicode.com
首页 > Web开发 > 详细

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

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

标签:style   blog   http   io   color   os   sp   on   文件   

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 配置虚拟目录和虚拟主机

标签:style   blog   http   io   color   os   sp   on   文件   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!