第一步: 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 noneOrder allow,deny
Allow from all
</Directory>
这样是允许的,但是不保证是安全的。
虚拟主机的话有时间再补