日期:2014-05-16 浏览次数:20880 次
Apache 配置虚拟目录是什么意思呢?
假如您现在的 Apache 配置文件(httpd.conf)中设置的访问路径为:E:/php/web 下,即DocumentRoot "E:/php/web"。哪如何设置一个别的盘符(比如:D盘)下面的一个目录,让 Web 服务器可以去访问呢?就需要配置虚拟目录。
下面为配置步骤:
1、配置虚拟目录就是增加一个节点,找到<IfModule>这块,加入下面的代码;
# 虚拟目录,访问D盘下面的web目录
<IfModule dir_module>
# 设置缺省载入页面
DirectoryIndex index.html index.htm index.php
# 设置站点别名,别名与访问路径是相关的,取任何名称都可以(除特殊)
Alias /myweb "D:/web"
<Directory D:/web>
# 设置访问权限
Order allow,deny
Allow from all
</Directory>
</IfModule>#DocumentRoot "E:/php/web"