apache 虚拟目录学习笔记

第一步:  httpd.conf    加入如下代码

#配置虚拟目录 frank
<IfModule dir_module>
#目录索引 文件名
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
                   default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
                   home.php home.pl home.cgi home.asp home.shtml home.html home.htm
#别名 
Alias /test "D:/test"
<Directory d:/test>
#访问权限设置
Order allow,deny
Allow from all
</Directory>

</IfModule>

## 关于目录权限详解 抛出链接http://blog.csdn.net/xy2204/article/details/45967115

第二步: 将文件默认的 documentRoot 注释掉,让服务器启动时从自己配置的文件找


值得注意的是 httpd.conf 中的<Directory></Directory> 中的默认配置是

#<Directory />
   AllowOverride none
    Require all denied

</Directory>

这个不改的话,应该会出现403 的错误

我改成了 

<Directory />

    AllowOverride none
    Order allow,deny
    Allow from all

</Directory>

这样是允许的,但是不保证是安全的。

虚拟主机的话有时间再补

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值