Category Archives: Hosting

modsecurity: error – PCRE limits exceeded

vi /usr/local/apache/conf/pcre_modsecurity_exceeded_limits.conf

SecPcreMatchLimit 150000
SecPcreMatchLimitRecursion 150000
chmod 600 /usr/local/apache/conf/pcre_modsecurity_exceeded_limits.conf

vi /usr/local/apachec/conf/modsec2.user.conf
in section IfModule mod_security2:

include "/usr/local/apache/conf/pcre_modsecurity_exceeded_limits.conf"

/etc/init.d/httpd restart

cPanel – DBI connect(‘modsec:localhost’,’modsec’,…) failed: Can’t connect to local MySQL server through socket

If you have error like:

/etc/cron.hourly/modsecparse.pl:

DBI connect(‘modsec:localhost’,’modsec’,…) failed: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) at /etc/cron.hourly/modsecparse.pl line 19
Unable to connect to mysql database at /etc/cron.hourly/modsecparse.pl line 19.

Fix:

less /etc/cron.hourly/modsecparse.pl

mysql;
use mysql;
UPDATE user SET Password=PASSWORD(‘$dbpassword’) WHERE USER=’modsec’;
flush privileges;
exit;

cpanel rndc: ‘reload’ failed: unexpected end of input

It usually means you have some syntax errors in your named.conf. And there are many chances after reboot bind will not start.

Ok lets fix it:

service named status
WARNING: key file (/etc/rndc.key) exists, but using default configuration file (/etc/rndc.conf)
version: 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1

you can try: /scripts/rebuildnamedconf

This script is deprecated. Please use /usr/local/cpanel/scripts/rebuilddnsconfig instead.
Executing /usr/local/cpanel/scripts/rebuilddnsconfig

Named could not be restarted, any obvious config errors should show up below this line.
WARNING: /etc/named.conf appears to contain errors which could not be corrected automatically!
/etc/named.conf:14394: unknown option ‘.tk.db’
/etc/named.conf:17217: unexpected end of input
Please correct these errors manually and rerun /usr/local/cpanel/scripts/fixrndc

you need manually check named.conf line 14394 and remove some incorrect entries from you configuration files.

then try to start named:

service named start

directadmin limit the number of emails sent by each user

if (open (LIMIT, “/etc/virtual/limit_$name”))

If you have that line in your exim.pl, then you’re good to go. If not, save it to /etc/exim.pl and restart exim. The same basic rules apply, you just need to type:
echo 300 > /etc/virtual/limit_username

where username is the User you wish to give the special limit to. This overrides the default /etc/virtual/limit file for that User.

If you think you might have a spammer, check your /etc/virtual/usage directory for a larger than normal filesize.
Any authenticated sends will show up with this command:
cd /var/log/exim
grep ‘A=login:’ mainlog* | less

which will show all emails sent from your server which used smtp-authentication. This is useful to find any email accounts who’s passwords may have been compromised (guessed), or simply just abusive Users.

With DA 1.42.0 and /etc/exim.pl version 13, you can use a per-email send limit, where you can limit each individual email account to a daily limit, eg:
echo 50 > /etc/virtual/user_limit
echo user_can_set_email_limit=1 >> /usr/local/directadmin/conf/directadmin.conf
/etc/init.d/directadmin restart

amavis – TROUBLE in pre_loop_hook: db_init: BDB no dbC: __fop_file_setup: Retry limit (100) exceeded, File exists. at (eval 80) line 283.

if you are getting some kind of error like this: delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused.

In your logs you can find some errors like: TROUBLE in pre_loop_hook: db_init: BDB no dbC: __fop_file_setup: Retry limit (100) exceeded, File exists. at (eval 80) line 283.

its amavis bug, you can fix it:

/etc/init.d/amavis stop
rm -rf /var/lib/amavis/db/*
/etc/init.d/amavis start
sendmail -q