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

,用记事本打开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 [email protected]

    DocumentRoot "D:\wamp\www"

    ServerName localhost

    ServerAlias localhost

    ErrorLog "logs/dummy-host.localhost-error.log"

    CustomLog "logs/dummy-host.localhost-access.log" common

    </VirtualHost>


你可能感兴趣的:(Apache配置httpd-vhosts虚拟主机总结及注意事项)