Interview Prep/Linux/Permissions, ownership, SELinux and mounts

Apache can't connect to a backend: `AH00957: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed` and `ausearch` shows `denied { name_connect }`.

IntermediateTroubleshootingPermissions, ownership, SELinux and mounts
Answer

Likely causes → SELinux blocks httpd_t from making outbound network connections by default.

Diagnose →

sudo ausearch -m AVC -c httpd -ts recent
getsebool httpd_can_network_connect

Fix → sudo setsebool -P httpd_can_network_connect on (or the narrower httpd_can_network_relay). If the backend port is unusual, label it: semanage port -a -t http_port_t -p tcp 8080 (8080 is usually already http_cache_port_t, which is allowed).

Prevent → Include required SELinux booleans in the role that deploys the reverse proxy.

All Linux questions Roadmap: Linux

More on Permissions, ownership, SELinux and mounts