在Ubuntu上的Apache我已经设置了一个vhost,但在浏览器中我不断收到“403 Access forbidden”错误;日志显示“客户端被服务器配置拒绝:/ home / remix /”.
在线寻找解决方案我发现很多关于目录访问的帖子(允许所有人等),但据我所知,我已经做到了.在httpd-vhosts.conf中有以下代码:
NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot "/opt/lampp/htdocs/" ServerName localhost ServerAlias localhost ErrorLog "logs/dummy-host.example.com-error_log" CustomLog "logs/dummy-host.example.com-access_log" common </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot "/home/remix/" ServerName testproject ServerAlias testproject <Directory "/home/remix/"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
我还补充道
127.0.0.1 testproject
到/ etc / hosts文件.
此外,/ home / remix /文件夹包含一个index.html文件,并在httpd.conf中启用了vhost.
有什么我没看到的吗?
编辑:这是Apache error_log条目:
[Sat Aug 18 09:15:32.666938 2012] [authz_core:error] [pid 6587] [client 127.0.0.1:38873] AH01630: client denied by server configuration: /home/remix/
解决方法
更改您的授权配置:
<Directory /home/remix/> #... Order allow,deny Allow from all </Directory>
…到Apache 2.4版本相同.
<Directory /home/remix/> #... Require all granted </Directory>
查看upgrading overview document以获取有关您可能需要进行的其他更改的信息 – 请注意,您在Google(以及本网站)上找到的大多数配置示例和帮助都是指2.2.