Affected versions: CentOS Stream 10

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Apache HTTPD on CentOS Stream 10 returns 403 for files in /srv/web.

Environment & Reproduction

Hosts hosting web content outside of default /var/www tree.

cat /etc/os-release
uname -r
rpm -qa | grep 

Root Cause Analysis

Custom path lacks httpd_sys_content_t SELinux context.

Quick Triage

Confirm package, network, SELinux and firewall state.

ls -Z /srv/web
ausearch -m AVC -ts recent
getenforce

Step-by-Step Diagnosis

Drill into selinux/denial state and recent journal entries to isolate the failure.

sealert -a /var/log/audit/audit.log
semanage fcontext -l | grep httpd
Illustrative mockup for centos-stream-10 — cs10-b02-p034-diag
Diagnosis console for SELinux denies HTTPD access to custom path on CentOS Stream 10 — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Apply the standard remediation for selinux/denial on CentOS Stream 10.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo semanage fcontext -a -t httpd_sys_content_t '/srv/web(/.*)?'
sudo restorecon -Rv /srv/web
Illustrative mockup for centos-stream-10 — cs10-b02-p034-fix
Remediation output for SELinux denies HTTPD access to custom path on CentOS Stream 10 — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Use setsebool httpd_read_user_content on if user content is hosted.

Verification & Acceptance Criteria

Validate the fix with positive functional checks before closing.

curl -I http://localhost/file
ls -Z /srv/web

Rollback Plan

Revert to the previous known-good configuration if the fix regresses.

sudo semanage fcontext -d '/srv/web(/.*)?'
sudo restorecon -Rv /srv/web

Prevention & Hardening

Codify the fix in configuration management and add monitoring.

Bake contexts into image build and use ansible sefcontext module.

HTTPD permission denied and port_t bindings.

Related tutorial: View the step-by-step tutorial for centos-stream-10.

View all centos-stream-10 tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

SELinux user guide.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.