SELinux is blocking an application (AVC denial)
The file permissions are correct and the operation still fails, because SELinux policy does not allow that process type to touch that file type.
What you see
A service cannot read a file, bind a port or write a directory, despite ls showing the right ownership and mode. Setting the service to permissive makes it work.
What is actually wrong
The file has the wrong SELinux context — very common after moving files with mv, restoring from a backup, or putting web content outside /var/www. Or the action genuinely needs a boolean turning on.
Codes and articles
Fixes (2)
Set the right file context — do not disable SELinux
A file or directory access is being denied.
Confirm it really is SELinux and read the denial.
sudo ausearch -m AVC,USER_AVC -ts recent | tail -40Get the human-readable explanation, which usually names the exact fix.
sudo sealert -a /var/log/audit/audit.log | head -60Compare the context on the problem path with one that works.
ls -Z /srv/www/index.htmlls -Z /var/www/html/index.html
mv preserves the original context; cp assigns the destination's. That single difference is behind most of these.
Add a permanent context rule for the path, then apply it.
sudo semanage fcontext -a -t httpd_sys_content_t '/srv/www(/.*)?'sudo restorecon -Rv /srv/www
semanage writes the rule to policy so it survives a relabel; restorecon alone would be undone the next time the filesystem is relabelled.
If the app needs to write as well, use httpd_sys_rw_content_t for those directories only.
Check whether a boolean covers what you need before writing a custom policy.
getsebool -a | grep httpd | grep ' on$\| off$'
sudo ausearch -m AVC -ts recent | tail -5Allow a service to bind a non-standard port
A daemon cannot bind the port you configured.
See which ports the type is already allowed.
sudo semanage port -l | grep http_port_tAdd the port to the type.
sudo semanage port -a -t http_port_t -p tcp 8085If it reports the port is already defined under another type, modify instead of adding.
sudo semanage port -m -t http_port_t -p tcp 8085Restart the service.
sudo systemctl restart httpd
sudo ss -tlnp | grep 8085Related faults
Where this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.