For Centos 5.2 + Virtualmin Pro
If you have more than 500 accounts, you get more than 100K mails (60% spam) a day and more then 500 GB Bandwidth Usage (don’t forget to make backups first):
1- In:
/etc/cron.hourly/00awstats
change this line:
if [ -f /var/log/httpd/access_log ] ; then
for
if [ -f /var/log/httpd/access_log_let_my_cpu_alone ] ; then
2- In: Webmin -> Webmin -> Webmin Configuration -> Advanced Options -> CPU priority for scheduled jobs, select Priority level = - 15
3- In: Virtualmin -> Email Messages -> Spam and Virus Scanning -> Enable ClamAV Server
Then go again to Virtualmin -> Email Messages -> Spam and Virus Scanning -> in SpamAssassin client program select: spamc -> in Maximum message size to process for spamc type: 1000000 -> in Virus scanning program select: Server scanner (clamdscan) -> and Save
4- In: Webmin -> System -> Bootup and Shutdown -> postfix -> Start at boot time? = No -> Save
DON’T FORGET to start postfix after booting!
We are doing this because if you are getting too much mails by starting the Server you will get out of memory (RAM and swap, if you are luky the kernel will stop postfix otherwise you will need to poweroff the server) (… too much lookup-domain processes will get started).
5- This point is only for experts! Don’t do it if you don’t know what are you doing! (don’t forget to do backups)
Type:
ulimit -n
if you see 1024 you can increase this number by doing this:
- In /etc/security/limits.conf add this 2 lines:
- soft nofile 4096
- hard nofile 4096
- In /etc/pam.d/login add this line:
session required pam_limits.so
- In /etc/rc.d/rc.local add this line:
ulimit -n 4096
- reboot
6- Adding this line in /etc/httpd/conf.d/fcgid.conf
MaxRequestsPerProcess 500
You should stop getting this error in /var/log/http/error_log:
Too many open files: mod_fcgid: couldn’t set child …
Don’t forget to restart your apache (/etc/init.d/httpd restart)
http://fastcgi.coremail.cn/doc.htm
7- You can save CPU usage by doing this:
Go to -> Webmin -> Servers -> Postfix Mail Server -> Delivery rates -> change:
Min time (secs) between attempts to deliver a deferred message = 500s
Time (secs) between scanning the deferred queue = 500s
Max time (days) in queue before message is undeliverable = 120m
Max time (secs) between attempts to deliver a deferred message = 2000s
Any more tips we will gratefull!! ;)<br><br>Post edited by: acid, at: 2008/10/20 12:49