首页 > 代码库 > 配置虚拟主机时遇到的问题

配置虚拟主机时遇到的问题

添加虚拟主机的配置后,始终apache服务启动不成功

后来在网上查到需要注释掉http.conf默认的配置DocumentRoot

#DocumentRoot "C:/wamp64/www/",注释掉这行就重启成功了。

 

下面的注释放开

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

 

并在httpd-vhosts.conf文件中添加

#配置我们自己的虚拟主机
<VirtualHost 127.0.0.100:80>
    #配置访问根目录
    DocumentRoot "e:/www/cehome"
    ServerName www.test.com
    #这里配置欢迎首页面
    DirectoryIndex index.html index.htm index.php
   

    <Directory "e:/www/cehome">
        Options FollowSymLinks
        #不允许别人修改我们的页面
        AllowOverride None
        #设置访问权限
        Order allow,deny
        Allow from All
    </Directory>
</VirtualHost>

配置虚拟主机时遇到的问题