Apach配置本地域名

分三步:

一,开启虚拟域名设置,在路径中找到(apache\apache2.4.9\conf)httpd.conf 配置文件,

去掉 " Include conf/extra/httpd-vhosts.conf "  前面的" # " # Virtual hosts Includeconf/extra/httpd-vhosts.conf

 

二,关联本地目录,在路径找到(apache\apache2.4.9\conf\extra)httpd-vhosts.conf 配置文件


<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:\wamp\www\newkir"
ServerName web.kir.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:\wamp\www"
ServerName localhost
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

 

三,关联本地域名解析,在路径找到(C:\Windows\System32\drivers\etc)hosts 配置文件,添加如下虚拟域名

127.0.0.1 localhost
127.0.0.1 web.kir.com

 

posted @ 2016-02-26 10:43  lokou  阅读(238)  评论(0编辑  收藏  举报