首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > Apache >

apache 本土配置虚拟主机,单ip多域名

2012-07-20 
apache 本地配置虚拟主机,单ip多域名1、打开httpd.conf 查找 #Include conf/extra/httpd-vhosts.conf将前面

apache 本地配置虚拟主机,单ip多域名


1、打开httpd.conf 查找 #Include conf/extra/httpd-vhosts.conf 将前面#去掉

2、打开 conf/extra/httpd-vhosts.conf

NameVirtualHost *:80

<VirtualHost *:80>
ServerName mysite1.com
DocumentRoot "E:/phpworks/apache/htdocs/mysite1"
ErrorLog "logs/dummy-host2.127.0.0.1-error.log"
CustomLog "logs/dummy-host2.127.0.0.1-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerName mysite2.com
DocumentRoot "E:/phpworks/apache/htdocs/mysite2"
ErrorLog "logs/dummy-host2.127.0.0.1-error.log"
CustomLog "logs/dummy-host2.127.0.0.1-access.log" common
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "E:/phpworks/apache/htdocs/mysite3"
ServerName mysite3.com
ErrorLog "logs/dummy-host2.127.0.0.1-error.log"
CustomLog "logs/dummy-host2.127.0.0.1-access.log" common

</VirtualHost>

3、修改host

127.0.0.1 mysite1.com
127.0.0.1 mysite2.com
127.0.0.1 mysite3.com

?

热点排行