Disable SELinux for only Apache / httpd in Linux

‮l.www‬autturi.com
Disable SELinux for only Apache / httpd in Linux

To disable SELinux for only the Apache (httpd) server on a Linux system, you can use the setsebool command.

  1. Use the setsebool command to disable the httpd_can_network_connect SELinux boolean:
sudo setsebool -P httpd_can_network_connect 0

This will disable the ability of the Apache server to connect to the network, which will effectively disable SELinux for the Apache server.

  1. Restart the Apache server to apply the changes:
sudo systemctl restart httpd

Disabling SELinux for the Apache server can affect the security and functionality of your system. Consult the documentation for your applications to ensure that they will still function properly after SELinux has been disabled for the Apache server.

Created Time:2017-10-28 14:02:27  Author:lautturi