May
23
2013
APACHE同一IP配置多个域名,Apache下同一个IP配置多个虚拟主机
作者:
绝缘体.. 发布:
2013-05-23 07:02 分类:
未分类 阅读:
抢沙发
APACHE同一IP配置多个域名,做web开发的应该非常熟悉了,不过还是总结一下防止以后搞忘了!
下面直接说该如何操作吧:
1.在windows2003下安装APACHE配置虚拟目录和UNIN下基本是一样的,就是修改httpd.conf文件(Apache2\conf\httpd.conf).
2.打开http.conf文件,在其最下发输入
NameVirtualHost 218.17.19.19 #服务器IP地址 <VirtualHost 218.17.19.19> #域名所指向的IP DocumentRoot "E:/webroot/phpernote" #域名所指向的目录,注意""不可少 ServerName www.phpernote.com #网站域名 DirectoryIndex index.php index.html default.php index.html.var </VirtualHost> <VirtualHost 218.17.19.19> #第二个网站域名所指向的IP DocumentRoot "E:/webroot/example" #www.example.com要指向的目录 ServerName www.example.com DirectoryIndex index.php index.htm index.html default.php index.html.var </VirtualHost>
更多个虚拟主机(域名配置)依次类推。
微信扫一扫,打赏作者吧~