apache2.4虚拟主机无法访问

养在鱼缸的鱼 发布于 2013/06/25 09:26
阅读 1K+
收藏 1
<VirtualHost 192.168.1.120>
    ServerAdmin zz167@zz167.com
    DocumentRoot "/usr/local/www/aaa/"
    ServerName 192.168.1.120
  <Directory "/usr/local/www/aaa/">
     Order deny,allow
     Deny from all
   </Directory>
    ErrorLog "logs/www.ip.com-error_log"
    CustomLog "logs/www.ip.com-access_log" common
</VirtualHost>
<VirtualHost www.bbb.com>
    ServerAdmin zz167@zz167.com
    DocumentRoot "/usr/local/www/bbb/"
    ServerName www.bbb.com
   <Directory "/usr/local/www/bbb/">
     Order deny,allow
     Allow from all
   </Directory>
    ErrorLog "logs/www.bbb.com-error_log"
    CustomLog "logs/www.bbb.com-access_log" common
</VirtualHost>
<VirtualHost www.aaa.com>
    ServerAdmin zz167@zz167.com
    DocumentRoot "/usr/local/www/aaa/"
    ServerName www.aaa.com
   <Directory "/usr/local/www/aaa/">
     Order deny,allow
     Allow from all
   </Directory>
    ErrorLog "logs/www.aaa.com-error_log"
    CustomLog "logs/www.aaa.com-access_log" common
</VirtualHost> 
我的虚拟主机如上面配置,这样出现了一个问题,就是 www.aaa.com这个可以访问,但是 www.bbb.com这个就报错了

错误如下:

Forbidden

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

请教一下,这个如何解决?
加载中
0
Choate
Choate

<VirtualHost www.bbb.com>

<VirtualHost www.aaa.com>

要么把域名换成IP,要么把域名换成*好。

0
养在鱼缸的鱼
养在鱼缸的鱼
都试过了,一样
0
hylent
hylent

都 deny from all 了 还这么访问 403 本来就是访问受限的意思啊

 

0
枫爱若雪
枫爱若雪

楼上+1 另外看看你网站路径是否正确,参看下我的空间里边的apache整合和排错吧

http://my.oschina.net/7shell/blog/107691

0
养在鱼缸的鱼
养在鱼缸的鱼

引用来自“hylent”的答案

都 deny from all 了 还这么访问 403 本来就是访问受限的意思啊

 

<VirtualHost www.aaa.com>
  ServerAdmin zz167@zz167.com
  DocumentRoot "/usr/local/www/aaa/"
  ServerName www.aaa.com
  <Directory "/usr/local/www/aaa/">
  Order deny,allow
  Allow from all
  </Directory>
ErrorLog "logs/www.aaa.com-error_log"
CustomLog "logs/www.aaa.com-access_log" common
</VirtualHost>
看这里啊,哥们,这里重定义了
返回顶部
顶部