此内容没有您所选择的语言版本。
5.5.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:
- By default, the
httpd_can_network_connect_dbBoolean is off, preventing Apache HTTP Server scripts and modules from connecting to database servers:getsebool httpd_can_network_connect_db
~]$ getsebool httpd_can_network_connect_db httpd_can_network_connect_db --> offCopy to Clipboard Copied! Toggle word wrap Toggle overflow - To temporarily enable Apache HTTP Server scripts and modules to connect to database servers, run the
setsebool httpd_can_network_connect_db oncommand as the Linux root user. - Use the
getsebool httpd_can_network_connect_dbcommand to verify the Boolean is enabled:getsebool httpd_can_network_connect_db
~]$ getsebool httpd_can_network_connect_db httpd_can_network_connect_db --> onCopy to Clipboard Copied! Toggle word wrap Toggle overflow This allows Apache HTTP Server scripts and modules to connect to database servers. - This change is not persistent across reboots. To make changes persistent across reboots, run the
setsebool -P boolean-name oncommand as the Linux root user:[7]setsebool -P httpd_can_network_connect_db on
~]# setsebool -P httpd_can_network_connect_db onCopy to Clipboard Copied! Toggle word wrap Toggle overflow
[7]
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.