[Apache] 2009-06-10 16:57 |
我来说两句
|
在Localhost上开几个虚拟主机,并在Apache上配置
Windows下有一个简单的DNS路由,就是利用 windows\system32\drivers\etc\hosts 这个文件
打开该文件,可以看到有下面的一条记录
127.0.0.1 localhost
这就是为什么我们在浏览器输入localhost的时候,总是会进入本机的原因。
好了,我们现在要继续增加几个虚拟的主机,其IP也全部指向本机。
127.0.0.1 www.host.lan 127.0.0.1 mysql.host.lan 127.0.0.1 jobeet.host.lan |
之后,只要在浏览器输入上面的网址的话,都会进入本机。
不过,单单设置了IP指向,还是没用的,还要解释虚拟主机的主机头
所以,我们还需要在Apache的httpd.conf中,加入以下资料:
NameVirtualHost 127.0.0.1:80 ServerName www.host.lan DocumentRoot "C:/WebSite" DirectoryIndex index.php |
其它两个也是类似的设置。之后再输入网址,就能直接到达你的虚拟主机首页了。

标签:
2009-06-17 at 07:12
Hello, All my pictures are 100% genuine and updated.. Sexy Kiev Girl. Kiev girls. I pretty.
2009-06-25 at 07:33
I think i’ve seen this somewhere before…but it’s not bad at all
2009-07-12 at 22:58
Rather interesting. Has few times re-read for this purpose to remember. Thanks for interesting article. Waiting for trackback
3 条留言 | 欢迎您也来跟两句
可用的HTML标签如下:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>