Tuesday, April 26, 2011

Exim : retry time not reached for any host after a long failure period

The issue is because of the corrupted exim db files.

Goto /var/spool/exim/db and delete files: retry , retry.lockfile , wait-remote_smtp, wait-remote_smtp.lockfile

/etc/init.d/exim restart

Friday, April 15, 2011

How to block access to your server from all IP except your

If your server had CSF then do the below step

close off all UDP/TCP ports in csf.conf, then add the IP's you want to allow access to csf.allow and csf.ignore. Just make sure you add the ips BEFORE doing so or you will lock yourself out.

after that run the below command

csf -r

If you are using IPTABLES then
#The below line will DROP all incoming connections.
iptables -P INPUT DROP

#Allow specific IPs to specific ports for example port 22 for IP 1.1.1.1
iptables -A INPUT -p tcp -s 1.1.1.1 --d-port 22 -j ACCEPT

In this fashion you can add your IPs in the allow list.

Thursday, April 14, 2011

CGI files showing 500 internal server in Plesk

If you getting 500 internal server while executing the CGI files then please check the error log of that particular domain

eg: /var/www/vhosts/domain.com/statistics/logs/error_log

1) The error log may be showing issue with suexec policy violation: see suexec log for more details
>> Then please check the suexec log in /etc/httpd/logs/suexec.log their you will get error like below
target uid/gid (10078/505) mismatch with directory (10078/504) or program (10078/505)

Fix: /bin/cp /usr/sbin/psa-suexec /usr/sbin/suexec
OR
cp -arf /usr/local/psa/suexec/psa-suexec /usr/sbin/suexec

restart the Apache and try to load the cgi file.
(Reason: Plesk uses it's own suexec file and it might have been replaced by the original one that comes with standard apache package. )


2) In the error log if you getting this error : Premature end of script headers:

Fix: Make sure that the cgi-bin/ folder has the following permissions and ownership:

drwxr-x--- myuser psaserv cgi-bin

The script itself must be owned by domain FTP user but group must be 'psacln':

-rwxr-xr-x myuser psacln script.cgi

The permission should be 755 for your script.cgi file.