月份: 2014-10

wampserver虚拟主机配置httpd-vhosts.conf

NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.localhost
DocumentRoot “D:\wamp\www”
ServerName localhost
ServerAlias localhost
ErrorLog “logs/dummy-host.localhost-error.log”
CustomLog “logs/dummy-host.localhost-access.log” common
</VirtualHost>

#
# 如果目录在 D:\wamp\www 下因为 D:\wamp\www 已经设置过权限了 所以 可以不用设置 <Directory “D:\webroot” >
# 否者需要 像下边的例子 设置 目录权限 <Directory “D:\webroot” >
#
<VirtualHost *:80>
ServerName 127.0.0.5
ServerAlias 127.0.0.6
ServerAdmin webmaster@dummy-host.localhost
DocumentRoot “D:\webroot”

ErrorLog “logs/dummy-host.localhost-error.log”
CustomLog “logs/dummy-host.localhost-access.log” common

<Directory “D:\webroot” >
    Options Indexes FollowSymLinks
  AllowOverride all
    Order Deny,Allow
Allow from all
</Directory>

</VirtualHost>