#Apache#多站点与虚拟目录配置

1、修改配置文件

Apache\conf\httpd.conf

找到 LoadModule vhost_alias_module modules/mod_vhost_alias.so     去掉前面的#

找到 Include conf/extra/httpd-vhosts.conf                                               去掉前面的#

2、多站点配置

Apache\conf\extra\httpd-vhosts.conf

增加(几个站点就增加几个)

<VirtualHost *:80>
DocumentRoot "../../wwwroot/dir1"
ServerName www.xxx.com
</VirtualHost>

 

3、虚拟目录配置

Apache\conf\httpd.conf

将以下代码加到httpd.conf文件的末尾
<IfModule dir_module>
# 设置缺省载入页面
DirectoryIndex index.html index.htm index.php
# 设置站点别名,别名与访问路径是相关的,取任何名称都可以(除特殊)
Alias /myhome "C:/ComsenzEXP/wwwroot/phpMyAdmin"
<Directory C:/ComsenzEXP/wwwroot/phpMyAdmin>
# 设置访问权限
Order allow,deny
Allow from all
</Directory>
</IfModule>

 

posted @ 2014-05-23 09:23  王大刀  阅读(192)  评论(0编辑  收藏  举报