读书人

Windows 上 Apache Virtualhost 设置

发布时间: 2012-10-25 10:58:57 作者: rapoo

Windows 下 Apache Virtualhost 设置

Apache with virtual host on Windows
一个很平常的问题,windows下怎么在apache上设置 virtualhost (虚拟主机),其实很简单。

这儿以xampp 为例。
第一,设置域名解析。
我们需要打开 host 这样一个文件,不同单位 windows 版本,其位置也不近相同,
Windows 3.1/95/98/ME:
c:\windows\hosts

Windows NT/2000/XP Pro:
c:\winnt\system32\drivers\etc\hosts or c:\windows\system32\drivers\etc\hosts

Windows XP Home:
c:\windows\system32\drivers\etc\hosts

Windows Vista:
C:\Windows\System32\Drivers\etc\hosts

用记事本打开 host 文件,如果你是vista,需要以administrator 运行记事本,在最下面添加:

127.0.0.1 wordpress.do
127.0.0.1 websitebaker.do

左边的ip 是这台电脑的IP地址,右边的是虚拟主机名(设置成功后就可以以这个虚拟主机名访问目录)。

来源:(http://blog.sina.com.cn/s/blog_60b5a8750100djpl.html) - Windows?下?Apache?Virtualhost?设置_风中这尘_新浪博客

第二,编辑httpd-vhosts.conf

用记事本打开httpd-vhosts.conf,该文件在xampp\Apache2.2\conf\extra,把下面的代码复制进去。

 代替原来的http://localhost/wordpressWindows 上 Apache Virtualhost 设置 访问网站了.

?

?

文章出处http://www.yaoyingying.com/

来源:(http://blog.sina.com.cn/s/blog_60b5a8750100djpl.html) - Windows?下?Apache?Virtualhost?设置_风中这尘_新浪博客

读书人网 >操作系统

热点推荐