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

httpd fails to start when configured on a non-standard port due to SELinux port type mismatch.

Environment & Reproduction

Seen after moving Apache to ports such as 8443 or 9090 without updating SELinux port labels.

Root Cause Analysis

http_port_t does not include the new port, so the targeted policy denies the bind operation.

Quick Triage

Inspect /var/log/audit/audit.log for AVC denials referencing name_bind and the chosen port.

Step-by-Step Diagnosis

Run: sudo ausearch -m AVC -ts recent | audit2why; sudo semanage port -l | grep http_port_t.

Illustrative mockup for centos-stream-10 — cp227_diag
audit2why httpd port denial — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Run: sudo semanage port -a -t http_port_t -p tcp 8443; sudo systemctl restart httpd.

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

Illustrative mockup for centos-stream-10 — cp227_fix
semanage port mapping applied — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Use a custom policy module from audit2allow when multiple ports or protocols are required.

Verification & Acceptance Criteria

httpd listens on the new port and no further AVC denials appear during startup.

Rollback Plan

Remove the port mapping with semanage port -d and revert httpd.conf Listen directives.

Prevention & Hardening

Keep an approved port label list and add SELinux port changes to provisioning automation.

Often combined with firewalld zone errors and missing http_port_t labels on similar services.

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

Red Hat SELinux User and Administrator guide and semanage(8) man page.

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.