Skip to main content
Home
badllama.com
  • Search
  • Log In

SELinux and Apache

jblocker's picture

Tue, 01/10/2012 - 14:22 by jblocker

For People who hate themselves and run SELinux

If you decide to run SELinux and Apache starts throwing errors like the following:

[Tue Jan 10 14:44:42 2012] [error] (13)Permission denied: proxy: HTTP: attempt to connect to 1.2.3.4:8080 (some_host_name) failed
[Tue Jan 10 14:44:42 2012] [error] ap_proxy_connect_backend disabling worker for (some_host_name)

Chances are SELinux is stopping Apache from making network connections. To correct this problem execute

setsebool -P httpd_can_network_connect 1

This will make the change to SELinux and also make the change persistent.

Now if you have multiple server with SELinux and someone other than yourself installed SELinux and didn't do it the same way twice, it would be handy to be able to compare the configs between the server and ensure that they all match where they are supposed to. In this situation execute the following to generate md5sum of all the ACTIVE config files and then compare the md5sum value between your servers.

find /etc/selinux/targeted/modules/active/ -type f | grep -v commit_num | sort | xargs md5sum | md5sum
Powered by Backdrop CMS