尝试访问常规文件时遇到apache权限问题

-edit2-wtf,现在正在寻找/etc/apache2/htdocs/file.ext。 WTF !!!!

我想static.mysite.com/file.ext访问/var/www/mysite/data/public/file.ext

所以我写了下面的Apache。 我得到一个403错误。 我的文件是2750.当我通过www.mysite.com/file.ext时,我可以看到它(这是通过mod_mono / xsp),但不是通过静态。 我该如何解决? 我更喜欢不更改权限

Forbidden You don't have permission to access /file.ext on this server. 

阿帕奇:

 <VirtualHost *:80> ServerName static.mysite.com <Directory /var/www/mysite/data/public> </Directory> </VirtualHost> 

– 编辑 – 我也注意到这在我的日志

 [Mon Mar 28 08:51:42 2011] [crit] [client 76.10.163.134] (13)Permission denied: /etc/apache2/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable 

<Directory>指令用于例如将访问控制应用于给定的目录; 它指定文档根目录。

尝试像这样:

 <VirtualHost *:80> ServerName static.mysite.com DocumentRoot /var/www/mysite/data/public <Directory /var/www/mysite/data/public> Order allow,deny Allow from all </Directory> </VirtualHost> 

可能是你的apache用户没有读取.htaccess权限。 尝试将其权限更改为更宽松的内容。

解决scheme:使用DocumentRoot而不是目录。

 <VirtualHost *:80> ServerName static.mysite.com DocumentRoot /var/www/mysite/data/public </VirtualHost> 

这几乎总是与更高的目录权限有关。

检查“数据”和“公共”目录权限也是可读的。

– 编辑 –

你可以试试这个: 博客链接