码迷,mamicode.com
首页 > Web开发 > 详细

Apache配置虚拟主机

时间:2014-12-30 13:34:55      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:

更改两个文件

 

一、apache\conf\extra\httpd-vhosts.conf

  ##<VirtualHost *:80>
  ##ServerAdmin postmaster@dummy-host2.localhost
  ##DocumentRoot "D:/xampp/htdocs/dummy-host2.localhost"
  ##ServerName dummy-host2.localhost
  ##ServerAlias www.dummy-host2.localhost
  ##ErrorLog "logs/dummy-host2.localhost-error.log"
  ##CustomLog "logs/dummy-host2.localhost-access.log" combined
  ##</VirtualHost>

 

 

  <VirtualHost *:80>
  ServerAdmin postmaster@dummy-host2.localhost
  DocumentRoot "D:/xampp/htdocs/ceshi.com"
  ServerName ceshi.com
  ServerAlias www.ceshi.com
  ErrorLog "logs/dummy-host2.localhost-error.log"
  CustomLog "logs/dummy-host2.localhost-access.log" combined
  </VirtualHost>

 

 

 

 

 

 

 

二、C:\Windows\System32\drivers\etc\hosts

  127.0.0.1       www.ceshi.com

 

这样就可以通过www.ceshi.com访问本地项目

 

Apache配置虚拟主机

标签:

原文地址:http://www.cnblogs.com/dzlffmx/p/4193393.html

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