Apache配置httpd-vhosts虚拟主机总结及注意事项

只谈情不闲聊 提交于 2019-12-02 02:23:03

,用记事本打开apache目录下httpd文件(如:D:\wamp\bin\apache\apache2.2.8\conf),找到如下模块


    # Virtual hosts

    #Include conf/extra/httpd-vhosts.conf


去掉前面的#,这样就开启了httpd-vhosts虚拟主机文件。这时候重启wamp环境,无法打开localhost,需要在httpd- vhosts.conf配置一下。


2,用记事本打开httpd-vhosts文件,配置好localhost虚拟主机,参照httpd- vhosts文件中实例,修改成如下:


    <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>


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!