SELinuxの設定
SELinuxの一時的無効化方法 †SELinuxが機能している時、以下の方法で一時的に無効化出来る。 # getenforce Enforcing ← SELinux機能は有効でアクセス制御も有効。 Permissive ← SElinuxはwarningを出すが、アクセス制限は行われない。 Disabled ← SElinux機能・アクセス制御ともに無効。 # setenforce 0 ← EnforcingからPermissiveに変更。Disabledには出来ない。 # setenforce 1 ← 上記のPermissiveからEnforcingに戻す。 注:Disabledの場合、Enforcing、Permissiveに変更は出来ない。 SELinuxの恒常的Disable方法 †# vi /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=enforcing ↓ SELINUX=disabled ← disabledにする。 # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted # SETLOCALDEFS= Check local definition changes SETLOCALDEFS=0 SELinuxの各パラメータの設定方法 †# getsebool パラメータ名 ← パラメータ名の値を表示する場合。 # getsebool -a ← 全てのパラメータの値を表示する場合。 # getsebool -a | grep httpd ← httpdをパラメータ名に持つパラメータの値を表示する場合。 # setsebool パラメータ名=1 ← パラメータ名の値を一時的にonにする。 # setsebool パラメータ名=0 ← パラメータ名の値を一時的にoffにする。 # setsebool -P パラメータ名=1 ← パラメータ名の値を恒常的にonにする。 SELinuxに起因する問題 †システム構築中にSELinuxに制限されてアプリケーションが動かないという問題が幾つか発生した。これらは、アプリケーション外のSELinuxの制限によるため、原因発見から解決まで時間がかかる。以下はその内容である。 /selinux/contextへの書込み許可がない。 †設定値:SELinuxをPermissive (setenforce 0) samba_enable_home_dirs †設定値:on httpd_disable_trans †設定値:on Not Found The requested URL /redmine/dispatch.cgi was not found on this server. 解析内容: [Sun May 09 18:44:48 2010] [error] *** Passenger could not be initialized because of this error: Cannot create FIFO file /tmp/passenger.2886/.guard: Permission denied (13) また、ブラウザーからアプリケーションにアクセスした時は以下のエラーがある。 [Sun May 09 21:07:09 2010] [error] [client 192.168.100.1] script not found or unable to stat: /var/www/html/redmine/dispatch.cgi dispatch.cgi was not found ps -efで稼動しているプロセスを調べると以下のPassengerのプロセスが無い。 mysqld_disable_trans †設定値:on MySQL データベースを初期化中: Installing MySQL system tables... : : 100514 2:33:38 [Warning] Can't create test file /apli/db/mysql/data/host.lower-test /usr/libexec/mysqld: Can't change dir to '/apli/db/mysql/data/' (Errcode: 13) 100514 2:33:38 [ERROR] Aborting : : And if you do mail us, you MUST use the /usr/bin/mysqlbug script! [失敗] 解析内容: Last-modified: 2014-03-11 (火) 01:59:57 (3699d)
|