Category Archives: Linux Administration

How to change SMTP server IP address in spam blacklist

Sometimes you want to temporarily use a secondary IP of your Linux server to connect to a remote server on a particular port.

It can be useful, for instance, if your SMTP server IP has been blacklisted for a temporary spam problem (caused by virus, account hacking, web exploit etc.).
After solving the problem, you may use a secondary IP in your server to bypass blacklists, giving time to main IP to “clean up”. To do so you can configure source NAT with iptables command.


iptables -t nat -A POSTROUTING -p tcp --dport 25 -j SNAT --to-source xx.xx.xx.xx

where xx.xx.xx.xx is a secondary IP of the server.
Now your mail will appear to originate from the secondary IP, without changing mail server configuration.

In the case of SMTP, it is important to be sure that the secondary IP has correct DNS resolutions, both inverse and direct, otherwise your mail may not be accepted by remote servers.

Watch out awstats upgrade with Plesk 10 and Centos 5

I recently had an unpleasant surprise updating packages on a Centos 5 server with Plesk 10.4.4.

The awstats statistics stopped working. The reason was the update of awstats-7.0-12012611.swsoft rpm with the update of Centos awstats-7.0-2.el5.rf .

I solved the problem by brutally removing the Centos package and reinstalling the Plesk one.


rpm -e --nodeps awstats 
wget http://64.131.90.31/PSA_10.4.4/dist-rpm-CentOS-5-x86_64/contrib/awstats-7.0-12012611.swsoft.noarch.rpm 
rpm -ivh awstats-7.0-12012611.swsoft.noarch.rpm 

How to solve “mod_fcgid: read data timeout in 40 seconds” in centos 5

In Centos 5 mod_fcgid version there is a bug that causes this error:


mod_fcgid: read data timeout in 40 seconds

in VirtualHosts regardless of the values of IPCCommTimeout and IPCConnectTimeout configured in /etc/httpd/conf.d/fcgid.conf.

On the net I found a solution which consists in inserting in every VirtualHost the parameters IPCCommTimeout IPCConnectTimeout, but for me it worked just inserting the following code ad first VirtualHost:


<VirtualHost *:80>
Include conf.d/virtualfcgi.conf
</VirtualHost>

and editing mod_fcgi parameters in file /etc/httpd/conf.d/virtualfcgi.conf


<IfModule mod_fcgid.c>
IdleTimeout 3600
ProcessLifeTime 7200
MaxProcessCount 64
DefaultMaxClassProcessCount 8
IPCConnectTimeout 300
IPCCommTimeout 7200
BusyTimeout 300
</IfModule>