码迷,mamicode.com
首页 > Windows程序 > 详细

Apache 虚拟机 vhosts C:\WINDOWS\system32\drivers\etc\hosts

时间:2016-05-03 12:37:13      阅读:375      评论:0      收藏:0      [点我收藏+]

标签:

一、添加服务端口
在文件Apache\conf\httpd.conf中,去掉前面的#号,重启
#LoadModule rewrite_module modules/mod_rewrite.so 

#Include conf/extra/httpd-vhosts.conf

 

二、在文件Apache\conf\extra\httpd-vhosts.conf 文件中,修改里面相应的配置:

NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin webmaster@d.localhost
    DocumentRoot "D:/wamp/www/Lee"
    ServerName www.lee.com
    ServerAlias www.dummy-host.localhost
    ErrorLog "logs/dummy-host.localhost-error.log"
    CustomLog "logs/dummy-host.localhost-access.log" common
</VirtualHost>

NameVirtualHost *:8001
<VirtualHost *:8001>
    ServerAdmin webmaster@d.localhost
    DocumentRoot "D:/wamp/www/LiMei"
    ServerName www.limei.com
    ErrorLog "logs/dummy-host2.localhost-error.log"
    CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>

三、打开C:\WINDOWS\system32\drivers\etc\hosts

127.0.0.1       localhost
127.0.0.1       www.paidad.cn

 

Apache 虚拟机 vhosts C:\WINDOWS\system32\drivers\etc\hosts

标签:

原文地址:http://www.cnblogs.com/shaoing/p/5454250.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!