Product SiteDocumentation Site

4.6.2. Configuring Booleans

Run the setsebool utility in the setsebool boolean_name on/off form to enable or disable Booleans.
The following example demonstrates configuring the httpd_can_network_connect_db Boolean:
Procedure 4.5. Configuring Booleans
  1. By default, the httpd_can_network_connect_db Boolean is off, preventing Apache HTTP Server scripts and modules from connecting to database servers:
    ~]$ getsebool httpd_can_network_connect_db
    httpd_can_network_connect_db --> off
    
  2. To temporarily enable Apache HTTP Server scripts and modules to connect to database servers, run the following command as root:
    ~]# setsebool httpd_can_network_connect_db on
  3. Use the getsebool utility to verify the Boolean has been enabled:
    ~]$ getsebool httpd_can_network_connect_db
    httpd_can_network_connect_db --> on
    
    This allows Apache HTTP Server scripts and modules to connect to database servers.
  4. This change is not persistent across reboots. To make changes persistent across reboots, run the setsebool -P boolean-name on command as root:[5]
    ~]# setsebool -P httpd_can_network_connect_db on
    


[5] To temporarily revert to the default behavior, as the Linux root user, run the setsebool httpd_can_network_connect_db off command. For changes that persist across reboots, run the setsebool -P httpd_can_network_connect_db off command.