Redhat "httpd"を起動できません。 「suEXEC」と「SELinux」の通知を表示

Redhat "httpd"を起動できません。 「suEXEC」と「SELinux」の通知を表示

私はRHEL6.5とApacheを使います2.2.15restartだった時はもう始めhttpdられませんでしたhttpd。以下を表示します/var/log/httpd/error_log

[Fri Aug 01 18:31:48 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Aug 01 18:32:35 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Fri Aug 01 18:32:35 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Aug 01 18:42:46 2014] [notice] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Fri Aug 01 18:42:46 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Aug 01 18:43:15 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Fri Aug 01 18:43:15 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Aug 01 18:43:59 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Aug 01 18:44:12 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Aug 01 18:45:03 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

実際にdisabled再起動しましたSELinux
何をすべきか教えていただけますか?

答え1

申し訳ありません。理由を見つけました。それはすべてSSL CERT問題についてです。上記の理由によるものではありませんnotices


上記のメッセージとは何の関係もありません。
したがって、それらを無視してください。


どうすればいいですか? Apache詳細ロギングを有効にすると、実際の操作が開始されます。 Apacheを起動したときにmod_sslモジュールをロードできないという現象を示し、実際に何が起こっているのかを示します。そして、これがssl.conf内部にSSL証明書(または対応する仮想ホストファイル)が構成されているために気づきました。

私はそこで2つの間違いを犯しました。まず、CERT関連ファイル(.crt/.key/.csr)への読み取り権限を付与していません。ところで、悪いことに、ファイルの1つにエラーが発生しました。

答え2

Apache Error [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

ある晴れた朝、Apache(httpd)サービスがダウンして起動しないことがわかりました。 :)

ステップ1:httpdサービスの状態を確認する:

#/etc/init.d/httpd status

httpdは死んだがpidファイルは存在する

ステップ2:httpdプロセスを検索して終了します。

#ps -ef | grep httpd

# killall -9 httpd

ステップ3:httpdロックファイルがある場合は削除します。

# rm -f /var/lock/subsys/httpd

ステップ4:Apache / httpdサービスの再起動

# service httpd restart
Stop httpd    [FAILED]
Start httpd   [FAILED]

追加の掘削が必要です。

ステップ5:httpdエラーログファイルを確認する

# grep suexec /var/log/httpd/error_log
[Sun Sep 22 10:32:06 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Sep 22 10:33:51 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Sep 22 10:38:03 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Sep 22 10:45:53 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

ステップ6:httpd nssエラーログファイルを確認する

#tail -300 /var/log/httpd/nss_error_log
[Sun Sep 22 04:03:27 2013] [error] Certificate not verified: 'Server-Cert'
[Sun Sep 22 04:03:27 2013] [error] SSL Library Error: -8181 Certificate has expired
[Sun Sep 22 04:03:27 2013] [error] Unable to verify certificate 'Server-Cert'. Add "NSSEnforceValidCerts off" to nss.conf so the server can start until the problem can be resolved.

[Sun Sep 22 10:38:03 2013] [error] Certificate not verified: 'Server-Cert'
[Sun Sep 22 10:38:03 2013] [error] SSL Library Error: -8181 Certificate has expired
[Sun Sep 22 10:38:03 2013] [error] Unable to verify certificate 'Server-Cert'. Add "NSSEnforceValidCerts off" to nss.conf so the server can start until the problem can be resolved.
[Sun Sep 22 10:45:53 2013] [error] Certificate not verified: 'Server-Cert'
[Sun Sep 22 10:45:53 2013] [error] SSL Library Error: -8181 Certificate has expired
[Sun Sep 22 10:45:53 2013] [error] Unable to verify certificate 'Server-Cert'. Add "NSSEnforceValidCerts off" to nss.conf so the server can start until the problem can be resolved.

この問題の根本原因は nss というモジュールにあります。mod_nss代替品です。実行しないmod_ssl操作を実行し、並列に実行できます。詳細については、[mod_nssとは何ですか、Mod_NSS設定情報、詳細について]リンクを参照してください。mod_sslmod_ssl

ステップ7:httpd conf.dディレクトリからnss.confファイルを削除する

#cd /etc/httpd/conf.d
#mv nss.conf nss.conf.orig
#mv ssl.conf ssl.conf.orig
#/etc/init.d/httpd start
Start httpd   [OK]

答え3

CentOS 6でmod_sslを再インストールしてくださいyum erase mod_sslyum mod_ssl

答え4

これは私の問題を解決しました。

yumpurge () 
{ 
    if [[ $# -eq 0 ]]; then
        echo "usage:
            removes packages including config files
            example:
            $0 ['pkg1 pkg2 pkgn']
            ";
        return 0;
    fi;
    for package in "$*";
    do
        echo "removing config files for $package";
        for file in $(rpm -q --configfiles $package);
        do
            echo "removing $file";
            echo "enter any key to confirm";
            rm -i -f $file;
        done;
        rpm -e $package;
    done
}


yumpurge  mod_ssl   httpd
yum install -y httpd mod_ssl

関連情報