Apache-路径的组件上缺少权限 [英] Apache - Permissions are missing on a component of the path

查看:106
本文介绍了Apache-路径的组件上缺少权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站图像都没有加载,尽管路径正确.在我的Apache日志中,我有很多:

None of my website images are loaded, although paths are correct. In my Apache logs, I have plenty of :

(13)Permission denied: [client 87.231.108.18:57108] AH00035: access to 
my/file/path/some-photo.jpg denied because search permissions are missing 
on a component of the path

httpd.conf文件中:

User apache
Group apache

一直到我的网站目录,文件夹由apache:apache拥有,而chmod一直设置为774.

All the way down to my website directory, folders are owned by apache:apache, with chmod set to 774 all the way down.

SELinux布尔值httpd_can_network_connect已经是On.

SELinux boolean httpd_can_network_connect has been is On.

我正在使用.htaccess文件将我的域名重定向到适当的目录.我怀疑这可能是问题的原因,但是...这不过是一种直觉.

I am using a .htaccess file to redirect my domain name to the appropriate directory. I suspect this might be cause the issue but... this is nothing more than a gut feeling.

我确实需要帮助,非常欢迎任何建议. 非常感谢!

I do need help, any suggestion is most welcomed. Many thanks!

编辑 .htaccess文件的内容:

EDIT Content of the .htaccess file :

RewriteEngine On
Options +FollowSymLinks

RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} www\.domain\.com
RewriteRule (.*) /domain/$1 [L]

推荐答案

我终于找到了它!多谢贾斯汀·鲁曼(Justin lurman)整理.htaccess文件.它让我看到Wordpress不再有权编辑我的.htaccess文件. 这更加奇怪,因为我100%地确定权限是好的(即使您问我,也太宽容了).

I finally found it! Thanks a ton Justin lurman to poiting out the .htaccess file. It made me see that Wordpress didn't have the right to edit my .htaccess file anymore. That was even more weird because I was 100% sure that permissions were good (even way too permissive if you ask me).

所以我研究了SElinux,因为我知道它有时会在我身上骗人,我是对的. 发出以下命令即可解决该问题:

So I looked into SElinux, as I know it can play tricks on me at times and I was right. Issuing the following command solved it :

chcon -R --type=httpd_sys_rw_content_t wp-content/

我希望能对其他人有所帮助:)

I hope that helps someone else :)

这篇关于Apache-路径的组件上缺少权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆