search

Home  >  Q&A  >  body text

Apache - Missing permissions for a component of path

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 the httpd.conf file:

User apache
Group apache

Go all the way to my website directory, the folder is owned by apache:apache, chmod is always set to 774.

SELinux Boolean httpd_can_network_connect is On.

I am using a .htaccess file 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!

edit Contents 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粉004287665P粉004287665404 days ago672

reply all(2)I'll reply

  • P粉216203545

    P粉2162035452023-10-20 00:28:41

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

    reply
    0
  • P粉647449444

    P粉6474494442023-10-20 00:17:22

    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 :)

    reply
    0
  • Cancelreply