cPanel, csf, General, Linux

Block domains having dynamic IPs using csf

Hi guys,

Sometimes there will be some domains (mostly email hosts) which have dynamic IP’s so that we cannot block a particular IP to block the domain on our server. CSF allows you to do this . it will refresh the particular domain and block the IPs during a mentioned time. We can set the time in configuration.

Go to csf configuration

cd /etc/csf/

vi csf.conf

Search for dyndns and DYNDNS on it and you can see some lines like below:

DYNDNS = “0” > it means the function is disabled. Change it to 1 and restart csf to activate this.

You can set the time interval between the checks here.

GLOBAL_DYNDNS_INTERVAL = “600”

Now, we need to specify the domain that we need to block in csf. For this, you need to edit the file csf.dyndns

cd /etc/csf/

vi csf.dyndns

Now add the domain you need to block.

Restart csf using csf -r

Standard
Apache, cPanel, General, Linux, Litespeed

mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

If you are seeing 500 error for the domains intermittently ,check the apache logs. If the error is like below.

==

[Mon Oct 20 15:11:44.915010 2014] [fcgid:warn] [pid 31253:tid 139991593948928] (104)Connection reset by peer: [client 173.xx.xx.xx:57094] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

[Mon Oct 20 16:57:08.367123 2014] [mpm_event:alert] [pid 7639:tid 139991619127040] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread

I have increased the value of parameter “MaxRequestWorkers” in apache configuration to resolve this error.

vi /usr/local/apache/conf/httpd.conf

here you can see a line like below

MaxRequestWorkers 250

Increase the value and restart apache to fix this error.

Standard
cPanel, General, Linux

Delete all eaccelerator files

eaccelerator filling the /tmp partition is a headache for admins. You can clear only the eaccelrator file from tmp partition using the below command.

==

find /tmp -name eaccelerator* \( -cmin +30 \) -exec rm -Rf ‘{}’ \;

==

You can also configure a cron to do this so that the system will perform this automatically in periods. Create a cronjob as below

Use the below command to edit the cron

crontab -e

add the below line

*/5 * * * * sh /root/tmpclear.sh

Now, navigate to the /root directory and create a file tmpclear.sh .

cd /root

vi /root/tmpclear.sh

add the below content in it and save

#!/bin/bash
cd /tmp
rm -f /tmp/*.txt /tmp/*.pl /tmp/*.html /tmp/bds /tmp/c99.* /tmp/*.tar /tmp/*.zip /tmp/*.gz /tmp/*.rar /tmp/2014* /tmp/2013*

That’s all 🙂

Standard
cPanel, General, Linux

ERROR: Could not complete request. Query: SELECT “INBOX” Reason Given: [SERVERBUG] Internal error occurred. Refer to server log for more information.

ERROR: Could not complete request.
Query: SELECT “INBOX”
Reason Given: [SERVERBUG] Internal error occurred. Refer to server log for more information.

If you see this error on your webmail, please do the steps below to get this fixed.

As the error says,refer to the log for further information.The log here is

/var/log/maillog

Login to the server and search the logs for the particular email account like below:

grep user@domain.com /var/log/maillog

You can see the reason for this error on this logs. In most of the cases it should be the error below.

==

Error: opendir(/home/user/mail/domain.com/emailuser/cur) failed: Permission denied (euid=511(conef) egid=510(conef) missing +r perm:/home/user/mail/domain.com/emailuser/cur)

==

In this case there is an ownership problem on the directory /home/user/mail/domain.com/emailuser/cur . Change this to the correct one to fix the issue.

chown user.  /home/user/mail/domain.com/emailuser/cur

Standard
Apache, cPanel, General, Linux, Mysql

Warning: mysqli::mysqli() [mysqli.mysqli]: Headers and client library minor version mismatch.

You can see this error in some of the websites. But if you check you can see mysql and mysqli is already enabled in the server.

====================================
root@server [~]# php -m | grep mysql
mysql
mysqli
pdo_mysql
====================================

To resolve the issue, we should try using mysqlnd with mysqli

To do this,do the steps below.

vi /var/cpanel/easy/apache/rawopts/all_php5

and add the below line

–with-mysqli=mysqlnd

Now recompile apache using the command

/scripts/easyapache

 

Standard