本文章将讲述如何配置本地域名访问。
1、打开%ApacheDir%/conf/httpd.conf,找到
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
把第二行前面的注释去掉,这样就可以通过修改httpd-vhosts.conf文件来达到配置虚拟主机的目的。
2、然后在httpd-vhosts.conf文件内容配置如下内容
ServerAdmin
webmaster@dummy-host.localhost
DocumentRoot "D:/OpenSource/wamp/www/"
ServerName localhost
ServerAlias
www.dummy-host.localhost
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common
ServerAdmin
webmaster@dummy-host2.localhost
DocumentRoot "D:/OpenSource/wamp/www/"
ServerName
www.gtlions.com
ServerAlias gtlions.com
ErrorLog "logs/dummy-gtlions.com-error.log"
CustomLog "logs/dummy-gtlions.com-access.log" common
3、最后修改hosts文件,在c:/windows/system32/drivers/etc/下面,添上两条
127.0.0.1 www.gtlions.com
127.0.0.1 gtlions.com
-The End-