Apache-一个IP多个主机域名

#配置虚拟主机名
NameVirtualHost 192.168.209.128
<VirtualHost 192.168.209.128>
    DocumentRoot /htdocs/win
    ServerName www.a.com
</VirtualHost>
<VirtualHost 192.168.209.128>
    DocumentRoot /htdocs/manager
    CustomLog /htdocs/manager/home-access_log common
    ServerName www.b.com
</VirtualHost>

#配置对应目录访问权限

<Directory "/htdocs/win">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<Directory "/htdocs/manager">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

#配置完毕后重启Apache并修改host文件使www.a.com和www.b.com都指向192.168.209.128

 

posted on 2013-11-13 15:24  John_ABC  阅读(331)  评论(0编辑  收藏  举报

导航