Show Table of Contents
5.6.2. ブール値の設定
setsebool boolean-name x コマンドは、ブール値をオンやオフにします。ここでの boolean-name はブール値名で、x を on にするとブール値をオンにし、off にするとブール値をオフにします。
以下の例では、
httpd_can_network_connect_db ブール値の設定を示しています。
- デフォルトでは、
httpd_can_network_connect_dbブール値はオフになっていて、Apache HTTP Server スクリプトとモジュールがデータベースサーバーに接続できないようになっています。~]$
getsebool httpd_can_network_connect_dbhttpd_can_network_connect_db --> off - Apache HTTP Server スクリプトとモジュールが一時的にデータベースサーバーに接続できるようにするには、Linux root ユーザーで
setsebool httpd_can_network_connect_db onコマンドを実行します。 getsebool httpd_can_network_connect_dbコマンドを使って、ブール値がオンになっていることを確認します。~]$
getsebool httpd_can_network_connect_dbhttpd_can_network_connect_db --> onこれで Apache HTTP Server スクリプトとモジュールがデータベースサーバーに接続できます。- この変更はリブート後には維持されません。リブート後にも変更を維持するには、Linux root ユーザーで
setsebool -P boolean-name onコマンドを実行します。~]#
setsebool -P httpd_can_network_connect_db on - 一時的にデフォルトの動作に戻すには、Linux root ユーザーで
setsebool httpd_can_network_connect_db offコマンドを実行します。リブート後も変更を維持するには、setsebool -P httpd_can_network_connect_db offコマンドを実行します。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.