如何在 cpanel CSF csf.pignore 中将 index.php 文件列入白名单以禁用“过度资源使用”警报?

如何在 cpanel CSF csf.pignore 中将 index.php 文件列入白名单以禁用“过度资源使用”警报?

cPanel(CSF)中的 ConfigServer 防火墙每天向我发送一百封电子邮件,说我的某个文件“占用了过多的资源”,我知道这个情况,但是对于该用户来说,高使用率是可以接受的。

这是无法容忍的。

以下是一个这样的例子:

[主题]

lfd on server1.evx.ca: Excessive resource usage: myuser (21046 (Parent PID:21014))

[电子邮件]

Time:         Wed Nov  2 14:23:36 2016 -0700
Account:      myuser
Resource:     Process Time
Exceeded:     1819 > 1800 (seconds)
Executable:   /usr/bin/php
Command Line: /usr/bin/php /mnt/home2/myuser/public_html/mywebsite.com/index.php
PID:          21046 (Parent PID:21014)
Killed:       No

我几个月前就把它添加到白名单了,但我仍然每天收到数十万封电子邮件。我受够了。

以下是我目前白名单中的内容:

文件:/etc/csf/csf.pignore

exe:/mnt/home2/myuser/public_html/mywebsite.com/index.php

当然,在过去的几个月里我已经多次重启了 CSF。

为什么它不起作用?我怎样才能让它起作用?

答案1

添加exe:/mnt/home2/myuser/public_html/mywebsite.com/index.php到进程忽略列表不会有帮助,因为该exe:命令只忽略可执行文件。

正如您在通知邮件中看到的:

Executable:   /usr/bin/php
Command Line: /usr/bin/php /mnt/home2/myuser/public_html/mywebsite.com/index.php

可执行文件是/usr/bin/php,您不应将其列入白名单,因为它会忽略所有 PHP。

相反,尝试添加以下行:

cmd:/usr/bin/php /mnt/home2/myuser/public_html/mywebsite.com/index.php

这应该正确忽略执行该特定文件的所有 php 进程。

您可以尝试的另一件事是

pcmd:*/mnt/home2/myuser/public_html/mywebsite.com/index.php

这将忽略以该文件路径结尾的所有命令,其中包括 php 进程。

答案2

尝试将“exe:/usr/bin/php”不带引号放入文件:/etc/csf/csf.pignore

相关内容