在 Ubuntu 上的 Apache 中,我设置了一个虚拟主机,但在浏览器中我不断收到“403 禁止访问”错误;日志显示“客户端被服务器配置拒绝:/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>
Run Code Online (Sandbox Code Playgroud)
我也添加了
127.0.0.1 testproject
Run Code Online (Sandbox Code Playgroud)
到 /etc/hosts 文件。
此外,/home/remix/ 文件夹包含一个 index.html 文件,并且在 httpd.conf 中启用了 vhost。
有什么我没有看到的吗?
编辑:这是 Apache error_log 条目:
[Sat Aug 18 09:15:32.666938 2012] …
Run Code Online (Sandbox Code Playgroud)