legacy-knowledge-base
公開されました Jun. 30, 2025

ModSecurityを起動できない

written-by

Jose L. Bango

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • ModSecurityを有効にしたり、 公式ドキュメントに従って新しいルールを追加しようとしても、うまくいきません。
  • デバッグログはオンになっているが、何も表示されない。

環境

  • Liferayエクスペリエンスクラウド - セルフマネージド

解像度

  • まず、 LCP_WEBSERVER_MODSECURITY 環境変数 ウェブサーバ/LCP.json.
  • 監査ログ(/var/log/modsec_audit.log)とは別に、 modsecurity.confでデバッグログをオンにしてみてください:
    SecDebugLog /var/log/modsec_debug.log
    SecDebugLogLevel 9
  • それにもかかわらず、 modsec_audit.logmodsec_debug.log に問題のトラブルシューティングに役立つものが何も表示されない場合、Nginxのログに次のようなものが表示されるかもしれません:
    2023/12/04 18:31:53 [emerg] 83#83: "modsecurity_rules_file" directive Rules error. File: /etc/nginx/modsec/modsecurity.conf. Line: 194. Column: 16. Failed to start DebugLog: Failed to open file: /opt/modsecurity/var/log/debug.log in /etc/nginx/nginx.conf:62
    nginx: [emerg] "modsecurity_rules_file" directive Rules error. File: /etc/nginx/modsec/modsecurity.conf. Line: 194. Column: 16. Failed to start DebugLog: Failed to open file: /opt/modsecurity/var/log/debug.log in /etc/nginx/nginx.conf:62
  • そうでない場合でも、 nginx.confを再確認してください。 例えば、 modsecurity off;.

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base