在wampserver3.0.6中配置虚拟主机(设置二级域名)

   高版本(wampserver3.0.6中为apache2.4.23)apache的配置文件httpd.conf,关于虚拟主机的配置不同于低版本,遇到问题网上搜索到的解决方式大部分是低版本的。以下是通过调试的配置方式:

  第一步:打开httpd.conf,去掉虚拟主机配置文件httpd-vhosts.conf注释

     # Virtual hosts

     Include conf/extra/httpd-vhosts.conf

第二步:配置httpd-vhosts.conf文件

   

<VirtualHost *:80>
    ServerName wiki.domain.com
    DocumentRoot d:/htdocs/wiki
       <Directory  "d:/htdocs/wiki">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
        Require all granted                    
       </Directory>    
</VirtualHost>

 注意要有Require all granted这句,否则会报错:

猜你喜欢

转载自www.cnblogs.com/zhijiangch/p/11707218.html
今日推荐