I'm trying to make my website, hosted on my CentOS 8, load up background.png file that is located on the same directory as rest of the website (/var/www/html) but the website refuses to load it and when I go directly to localhost/background.png I get an access denied -error.
On the error log I get "AH00132: file permissions deny server access". My stylesheet and PHP files on the same directory work fine.
I've looked up different ways to solve this online but I just can't seem to fix it and it has gotten really frustrating. I should only need to use one image (at least for now) for my website so I could theoretically use one that is hosted online but for a couple of reasons I prefer not to.
Things I've tried:
- Used chmod 755 to the .png file and even used chown/chmod --reference from an accessible file
- have mod-mime "AddType image/png .png"
- don't have .htaccess other than some password related stuff for my phpmyadmin
- added "AllowOverride All, Allow from all, Require all granted" on the httpd conf under the /var/www/html -directory bracket
- restarted httpd
- cleared the browser
Any other ideas? Outside of basics I'm a newbie when it comes to Linux so don't use fancy terms pls :p
EDIT:
Issue was on SELinux. After following this https://superuser.com/a/988862 guide I managed to let SELinux allow read access to the file. Thanks for the help!