以添加域名dashu.com为例:wamp\alias下新建文件dashu.com.configapache
NameVirtualHost dashu.com <VirtualHost dashu.com> DocumentRoot "D:/Program Files/wamp/www/xjdold/" ServerName dashu.com <Directory "D:/Program Files/wamp/www/xjdold/"> Options FollowSymLinks Indexes AllowOverride All Order deny,allow Allow from all #Require all granted </Directory> </VirtualHost> <VirtualHost localhost> DocumentRoot "D:/Program Files/wamp2.1/www" ServerName localhost <Directory "D:/Program Files/wamp2.1/www"> Options FollowSymLinks Indexes AllowOverride All Order deny,allow Allow from all #Require all granted </Directory> </VirtualHost>
可能出现的错误:ide
1.wamp 多域名配置 只有第一个域名被解析ui
看看virtualHost 前是否少了NameVirtualHost dashu.com,老版本的apache中,没有NameVirtualHost ,<VirtualHost>标签就没什么做用(新版的Apache已经去除了NameVirtualHost 这个配置)
2.报下面错误this
The server encountered an internal error or misconfiguration and was unable to complete your request.spa
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.code
More information about this error may be available in the server error log.orm
而后查看apache error log发现报错:configuration error: couldn't perform authentication. AuthType not setserver
解决方法:若是Apache版本小雨2.4,去掉Require all granted这行,若是大于2.4,就去掉Allow from allblog