Troubleshooting
A PHP application served by Apache on an SELinux-enforcing RHEL server cannot connect to a PostgreSQL database at 10.0.5.20 on TCP 5432. Connectivity tests from the host succeed, and the application works after setenforce 0. ausearch -m avc shows httpd_t denied name_connect to postgresql_port_t. What is the BEST fix?
Show the answer
Correct answerA. Run setsebool -P httpd_can_network_connect_db on to allow Apache database connections
The denial is httpd_t connecting to a database port, which the persistent httpd_can_network_connect_db boolean permits. Relabelling files does not help because the denial is about a network connection, not a file context. Permissive mode removes protection system-wide.