简体   繁体   English

这个apache virtualhost指令有什么问题?

[英]What is wrong with this apache virtualhost directive?

I'm getting 403 forbidden errors with this virtualhost directory in apache 2.2. 我在apache 2.2的virtualhost目录中收到403禁止的错误。 Can anyone help, please? 有人可以帮忙吗?

<VirtualHost *:80>
  ServerName www.xyz.com
  ServerAlias xyz.com
  DocumentRoot "/home/bruce/projects/links/www"

  <Directory />
    AllowOverride None
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all
  </Directory>

  DirectoryIndex index.html index.htm index.jsp index.php
</VirtualHost>

Thanks! 谢谢!

EDIT error in log is 日志中的EDIT错误为

(13)Permission denied: access to / denied

If i'm not wrong you have indicated the root directory of you file system in < Directory> It should be: 如果我没记错的话,您已经在< Directory>指出了文件系统的根目录,它应该是:

<VirtualHost *:80>
ServerName www.xyz.com
ServerAlias xyz.com
DocumentRoot "/home/bruce/projects/links/www"

<Directory /home/bruce/projects/links/www>
...

Gah. 加。 It ended up being that I was indeed forbidden from accessing that page. 最终导致我确实被禁止访问该页面。 I am using a new virtual server provider, and they have set up my /home account as readable only by me. 我正在使用新的虚拟服务器提供商,并且他们将我的/ home帐户设置为仅我可以读取。 As a result, the user running apache was unable to view the files. 结果,运行apache的用户无法查看文件。 I've changed the permissions on my home directory to be more lenient and now everything works as expected. 我将主目录上的权限更改为更宽松,现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM