Apache mod_security 和聊天服务器
Apache mod_security and chat server
我的网站托管在运行 Apache 和 Plesk 的虚拟服务器上。我想在我的网站上整合来自 livezilla.de 的聊天。聊天服务器也在我的服务器上运行。
为了保护我的系统,我已经激活了 plesk_modsecurity。但是,该特定模块禁止聊天的每个用户的 IP 地址,因为聊天非常频繁地 ping 服务器。
是否有可能 (a) 允许从聊天到聊天服务器的请求不受限制,反之亦然,同时 (b) 任何其他请求仍由模块处理并具有适当的限制?
或者您会推荐其他解决方案吗?
以下列表显示了 modsecurity 规则引发的一些错误。
Message: Rule 7f7e7ac18c30 [id "340159"][file "/etc/apache2/modsecurity.d/rules/tortix/modsec/50_plesk_basic_asl_rules.conf"][line "114"] - Execution error - PCRE limits exceeded (-8): (null).
Message: Rule 7f7e7abb2c60 [id "340157"][file "/etc/apache2/modsecurity.d/rules/tortix/modsec/50_plesk_basic_asl_rules.conf"][line "135"] - Execution error - PCRE limits exceeded (-8): (null).
Apache-Error: [file "apache2_util.c"] [line 273] [level 3] [client XX.XXX.XX.XXX] ModSecurity: Rule 7f7e7ac18c30 [id "340159"][file "/etc/apache2/modsecurity.d/rules/tortix/modsec/50_plesk_basic_asl_rules.conf"][line "114"] - Execution error - PCRE limits exceeded (-8): (null). [hostname "mydomain.tld"] [uri "/livezilla/server.php"] [unique_id "WzIClVXWzdsAABSrkdgAAAAE"]
Apache-Error: [file "apache2_util.c"] [line 273] [level 3] [client XX.XXX.XX.XXX] ModSecurity: Rule 7f7e7abb2c60 [id "340157"][file "/etc/apache2/modsecurity.d/rules/tortix/modsec/50_plesk_basic_asl_rules.conf"][line "135"] - Execution error - PCRE limits exceeded (-8): (null). [hostname "mydomain.tld"] [uri "/livezilla/server.php"] [unique_id "WzIClVXWzdsAABSrkdgAAAAE"]
Apache-Handler: proxy:unix:///var/www/vhosts/system/mydomain.tld/php-fpm.sock|fcgi://127.0.0.1:9000
Stopwatch: 1530004117657831 96698593 (- - -)
Stopwatch2: 1530004117657831 96698593; combined=96528507, p1=2, p2=96528499, p3=2, p4=1, p5=3, sr=0, sw=0, l=0, gc=0
Producer: ModSecurity for Apache/2.9.2 (http://www.modsecurity.org/); 201806211447.
Server: Apache
Engine-Mode: "ENABLED"
试试 ModSecurity 的 LocationMatch 指令。浏览至 工具与设置 > Web 应用程序防火墙 (ModSecurity) > 设置 > 自定义 并添加以下指令:
<LocationMatch "/livezilla/">
SecRuleEngine Off
</LocationMatch>
它将为 /livezilla/server.php
等 URI 禁用 ModSecurity
我的网站托管在运行 Apache 和 Plesk 的虚拟服务器上。我想在我的网站上整合来自 livezilla.de 的聊天。聊天服务器也在我的服务器上运行。
为了保护我的系统,我已经激活了 plesk_modsecurity。但是,该特定模块禁止聊天的每个用户的 IP 地址,因为聊天非常频繁地 ping 服务器。
是否有可能 (a) 允许从聊天到聊天服务器的请求不受限制,反之亦然,同时 (b) 任何其他请求仍由模块处理并具有适当的限制?
或者您会推荐其他解决方案吗?
以下列表显示了 modsecurity 规则引发的一些错误。
Message: Rule 7f7e7ac18c30 [id "340159"][file "/etc/apache2/modsecurity.d/rules/tortix/modsec/50_plesk_basic_asl_rules.conf"][line "114"] - Execution error - PCRE limits exceeded (-8): (null).
Message: Rule 7f7e7abb2c60 [id "340157"][file "/etc/apache2/modsecurity.d/rules/tortix/modsec/50_plesk_basic_asl_rules.conf"][line "135"] - Execution error - PCRE limits exceeded (-8): (null).
Apache-Error: [file "apache2_util.c"] [line 273] [level 3] [client XX.XXX.XX.XXX] ModSecurity: Rule 7f7e7ac18c30 [id "340159"][file "/etc/apache2/modsecurity.d/rules/tortix/modsec/50_plesk_basic_asl_rules.conf"][line "114"] - Execution error - PCRE limits exceeded (-8): (null). [hostname "mydomain.tld"] [uri "/livezilla/server.php"] [unique_id "WzIClVXWzdsAABSrkdgAAAAE"]
Apache-Error: [file "apache2_util.c"] [line 273] [level 3] [client XX.XXX.XX.XXX] ModSecurity: Rule 7f7e7abb2c60 [id "340157"][file "/etc/apache2/modsecurity.d/rules/tortix/modsec/50_plesk_basic_asl_rules.conf"][line "135"] - Execution error - PCRE limits exceeded (-8): (null). [hostname "mydomain.tld"] [uri "/livezilla/server.php"] [unique_id "WzIClVXWzdsAABSrkdgAAAAE"]
Apache-Handler: proxy:unix:///var/www/vhosts/system/mydomain.tld/php-fpm.sock|fcgi://127.0.0.1:9000
Stopwatch: 1530004117657831 96698593 (- - -)
Stopwatch2: 1530004117657831 96698593; combined=96528507, p1=2, p2=96528499, p3=2, p4=1, p5=3, sr=0, sw=0, l=0, gc=0
Producer: ModSecurity for Apache/2.9.2 (http://www.modsecurity.org/); 201806211447.
Server: Apache
Engine-Mode: "ENABLED"
试试 ModSecurity 的 LocationMatch 指令。浏览至 工具与设置 > Web 应用程序防火墙 (ModSecurity) > 设置 > 自定义 并添加以下指令:
<LocationMatch "/livezilla/">
SecRuleEngine Off
</LocationMatch>
它将为 /livezilla/server.php
等 URI 禁用 ModSecurity