Apache - Missing permissions for a component of path
P粉004287665
P粉004287665 2023-10-19 08:52:40
0
2
576

None of my website images load despite the correct path. In my Apache logs I have a lot 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

In thehttpd.conffile:

User apache Group apache

Go all the way to my website directory, the folder is owned byapache:apache,chmodis always set to774.

SELinux Booleanhttpd_can_network_connectisOn.

I am using a.htaccessfile to redirect my domain name to the appropriate directory. I suspect this might be the cause of the problem, but... it's nothing more than a hunch.

I really need help and any suggestions are very welcome. Thank you so much!

editContents of .htaccess file:

RewriteEngine On Options +FollowSymLinks RewriteCond %{HTTP_HOST} ^domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/ [R=301,L] RewriteCond %{HTTP_HOST} www.domain.com RewriteRule (.*) /domain/ [L]

P粉004287665
P粉004287665

reply all (2)
P粉216203545

In my case, the containing folder didn't have x permissions, changing it to 755 did the trick.

    P粉647449444

    I finally found it! Many thanks to Justin lurman for pointing out the .htaccess file. It lets me see that Wordpress no longer has permission to edit my .htaccess file. This is even weirder because I'm 100% sure the permissions are fine (or even too permissive if you ask me).

    So I looked into SElinux because I knew it would trick me sometimes, and I was right. Issuing the following command resolved the issue:

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

    I hope it helps others :)

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!