开发者社区> 问答> 正文

apache2.4虚拟主机无法访问?报错

<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.

请教一下,这个如何解决?

展开
收起
爱吃鱼的程序员 2020-06-22 18:46:25 507 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    <VirtualHostwww.bbb.com>

    <VirtualHostwww.aaa.com>

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

    都试过了,一样

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

     

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

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

    引用来自“hylent”的答案

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

     

    2020-06-22 18:46:40
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Apache Flink技术进阶 立即下载
Apache Spark: Cloud and On-Prem 立即下载
Hybrid Cloud and Apache Spark 立即下载

相关镜像