【发布时间】:2014-05-30 12:37:17
【问题描述】:
我全新安装了 ubuntu 并安装了 xampp。如果我在浏览器中输入“localhost”,则会出现正确的 XAMPP 页面。
现在我想将 htdocs 文件夹更改为“/home/adam/Web/mydomain.de”。 因此,我在 /opt/lamp 中取消了“包含 etc/extra/httpd-default.conf”的注释。 p/etc/httpd.conf 和我添加了
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/home/adam/Web/mydomain.de"
ServerName mydomain.de
ServerAlias www.mydomain.de
ErrorLog "logs/mydomain.de-error_log"
CustomLog "logs/mydomain.de-access_log" common
</VirtualHost>
到 /opt/lampp/etc/extra/httpd-vhost.conf 。
如果我在浏览器中输入“www.mydomain.de”,我会得到:
禁止访问!
您无权访问请求的目录。没有索引文档或目录被读保护。
但是有一个 index.php 文件,文件夹 Web 和所有子目录都有 chmod 777 并且我也被设置为这些文件的所有者 - 为什么它不起作用?另外,当我将代码更改为
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/opt/lampp/htdocs"
ServerName mydomain.de
ServerAlias www.mydomain.de
ErrorLog "logs/mydomain.de-error_log"
CustomLog "logs/mydomain.de-access_log" common
</VirtualHost>
然后“www.mydomain.de”再次返回预期的 XAMPP 页面。因此,出于某种原因,我的文件夹看起来确实没有读取权限 - 即使它具有正确的权限。怎么了?
【问题讨论】: