码迷,mamicode.com
首页 > 其他好文 > 详细

虚拟主机配置

时间:2016-08-23 18:59:10      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

1. 找到文件  C:\Windows\System32\drivers\etc\hosts
添加你的域名
127.0.0.1       localhost
127.0.1.1      tpshop.com
127.0.1.1      www.tpshop.com
2. 找到文件D:\wamp\bin\apache\apache2.4.9\conf\httpd.conf
# Virtual hosts
Include conf/extratpd-vhosts.conf   /到这一行,将#去掉 开启虚拟主机
3. 找到文件D:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
添加两个指向
<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>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:/wamp/wwwshop"
    ServerName tpshop.com
    ServerAlias www.tpshop.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 192.168.10.58    
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

虚拟主机配置

标签:

原文地址:http://www.cnblogs.com/dreamydeng/p/5800425.html

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