Troubleshooting
A web administrator moves site content to /data/site on a RHEL-based server running SELinux in enforcing mode. Apache (httpd) now returns 403 Forbidden even though the files are readable by all users. ausearch shows an AVC denial for httpd_t reading files labeled default_t. What is the BEST fix?
Show the answer
Correct answerB. Add a file context rule with semanage fcontext for /data/site(/.*)?, then run restorecon -Rv /data/site
The denial comes from the SELinux file label, not from permissions. A semanage fcontext rule records the correct type persistently, and restorecon applies it to the existing files. chcon sets the label but is not recorded in policy, so a relabel or restorecon can revert it. Disabling SELinux or opening permissions does not fix the label.