wamp 多域名配置

以添加域名dashu.com为例:wamp\alias下新建文件dashu.com.config

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>

可能出现的错误:

1.wamp 多域名配置 只有第一个域名被解析

看看virtualHost 前是否少了NameVirtualHost dashu.com,老版本的apache中,没有NameVirtualHost ,<VirtualHost>标签就没什么作用(新版的Apache已经去除了NameVirtualHost 这个配置)

2.报下面错误

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

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.

More information about this error may be available in the server error log.

然后查看apache error log发现报错:configuration error:  couldn't perform authentication. AuthType not set

解决方法:如果Apache版本小雨2.4,去掉Require all granted这行,如果大于2.4,就去掉Allow from all

 
posted on 2015-09-09 09:11  jly553  阅读(209)  评论(0编辑  收藏  举报