linux – Apache“服务器配置拒绝客户端”,尽管允许访问目录(vhost配置)

前端之家收集整理的这篇文章主要介绍了linux – Apache“服务器配置拒绝客户端”,尽管允许访问目录(vhost配置)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在Ubuntu上的Apache我已经设置了一个vhost,但在浏览器中我不断收到“403 Access forbidden”错误;日志显示“客户端被服务器配置拒绝:/ home / remix /”.

在线寻找解决方案我发现很多关于目录访问的帖子(允许所有人等),但据我所知,我已经做到了.在httpd-vhosts.conf中有以下代码

  1. NameVirtualHost *:80
  2.  
  3. <VirtualHost *:80>
  4. ServerAdmin webmaster@dummy-host.example.com
  5. DocumentRoot "/opt/lampp/htdocs/"
  6. ServerName localhost
  7. ServerAlias localhost
  8. ErrorLog "logs/dummy-host.example.com-error_log"
  9. CustomLog "logs/dummy-host.example.com-access_log" common
  10. </VirtualHost>
  11.  
  12. <VirtualHost *:80>
  13. ServerAdmin webmaster@localhost
  14. DocumentRoot "/home/remix/"
  15. ServerName testproject
  16. ServerAlias testproject
  17. <Directory "/home/remix/">
  18. Options Indexes FollowSymLinks Includes ExecCGI
  19. AllowOverride All
  20. Order allow,deny
  21. Allow from all
  22. </Directory>
  23. </VirtualHost>

我还补充道

  1. 127.0.0.1 testproject

到/ etc / hosts文件.

此外,/ home / remix /文件夹包含一个index.html文件,并在httpd.conf中启用了vhost.

有什么我没看到的吗?

编辑:这是Apache error_log条目:

  1. [Sat Aug 18 09:15:32.666938 2012] [authz_core:error] [pid 6587]
  2. [client 127.0.0.1:38873] AH01630: client denied by server configuration: /home/remix/

解决方法

更改您的授权配置:
  1. <Directory /home/remix/>
  2. #...
  3. Order allow,deny
  4. Allow from all
  5. </Directory>

…到Apache 2.4版本相同.

  1. <Directory /home/remix/>
  2. #...
  3. Require all granted
  4. </Directory>

查看upgrading overview document获取有关您可能需要进行的其他更改的信息 – 请注意,您在Google(以及本网站)上找到的大多数配置示例和帮助都是指2.2.

猜你在找的Linux相关文章