日期:2014-05-16  浏览次数:20747 次

apache配置多域名问题
配置了多个域名a.com对应/a  b.com对应/b
现在/a下有/a/news  /b下有/b/news
怎么配置才能访问a.com/news b.com/news的时候分别指向各自的news文件夹下呢?
------解决方案--------------------
<VirtualHost *:80>
    ServerAdmin webmaster_a@localhost
    DocumentRoot "/var/web/a/"
    ServerName a.com
    ServerAlias www.a.com
    ErrorLog "/TEMP/logs/a_error.log"
    CustomLog "/TEMP/logs/a_access.log" common
<Directory ""/var/web/a/">
      AllowOverride ALL
      Options -Indexes FollowSymLinks
      Order allow,deny
      Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster_b@localhost
    DocumentRoot "/var/web/b/"
    ServerName b.com
    ServerAlias www.b.com
    ErrorLog "/TEMP/logs/b_error.log"
    CustomLog "/TEMP/logs/b_access.log" common
<Directory "/var/web/b/">
      AllowOverride ALL
      Options -Indexes FollowSymLinks
      Order allow,deny
      Allow from all
</Directory>
</VirtualHost>