Reputation: 2316
Images are not loading in my server, This is the error I am getting
Forbidden You don't have permission to access PATH/abc.png on this server
I can access the images folder and all the images are listed but couldn't access it using url. There is no issue with Permission I have tried all permission levels including 777.
Upon research I found the issue may be with the apache config file. This is how a part of httpd.conf looks like
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
And there are no Aliases set for images. Thanks in advance.
Upvotes: 1
Views: 2814
Reputation: 675
Well, your httpd.conf seems all right and you have also tried to access files by giving permissions 777. But still you are unable to access your files.
This means that something else is denying the access. And this behavior is similar to SELinux Access Control.
So, relabeling files using chcon will solve this permission problem.
chcon -Rht httpd_sys_content_t /path/to/images/directory
CentOS wiki has a good explanation on SELinux Access Control
Upvotes: 5