-
Tuning the Apache Prefork MPM
To find httpd process avg memory usage: [root@webserverpage /]#ps -ylC httpd | awk ‘{x += $8;y += 1} END {print “Apache Memory Usage (MB): “x/1024; print “Average Proccess Size (MB): “x/((y-1)*1024)}’ TOTAL: 31.6831 To find after excluding httpd and mysql total memory so that we can get other processes usage memory: [root@webserverpage /]# ps -eo…
-
How to use IPTABLES
To Drop IP in iptables Port Specific: iptables -A INPUT -p tcp -s xx.xx.xx.xx –dport {PORT} -j DROP iptables -A INPUT -p tcp -s xx.xx.xx.xx –dport 80 -j DROP /sbin/service iptables save No Port Specified: iptables -A INPUT -s xx.xx.xx.xx -j DROP /sbin/service iptables save Example: /sbin/iptables -I INPUT -s {IP-HERE} -j DROP /sbin/iptables -I…
-
Boot Repair
Boot-Repair is a simple tool to repair frequent boot issues you may encounter in Ubuntu like when you can’t boot Ubuntu after installing Windows or another Linux distribution, or when you can’t boot Windows after installing Ubuntu, or when GRUB is not displayed anymore, some upgrade breaks GRUB, etc. Boot-Repair lets you fix these issues…
-
Setting timezone and synchronizing time with NTP
Check available timezones in your server by executing the command below. ls /usr/share/zoneinfo/ Then simply delete the current timezone: rm /etc/localtime Create a symbolic link to /etc/localtime. ln –s /usr/share/zoneinfo/Asia/Singapore /etc/localtime If symblolic link not working, then you may use a copy command. cp /usr/share/zoneinfo/Asia/Singapore /etc/localtime Install NTP yum install ntp See all the timezones…
-
How to enable port 587 (submission) in postfix
To enable port 587, edit the file /etc/postfix/master.cf vi /etc/postfix/master.cf and remove the # in front of the line: #submission inet n – n – – smtpd so that it looks like this: submission inet n – n – – smtpd and restart postfix: /etc/init.d/postfix restart
-
How to find which domain spamming via PHP script?
PLESK 1) Create a /var/qmail/bin/sendmail-wrapper script with the following content: #!/bin/sh (echo X-Additional-Header: $PWD ;cat) | tee -a /var/tmp/mail.send|/var/qmail/bin/sendmail-qmail “$@” Note, it should be two lines including ‘#!/bin/sh’. 2) Create a log file /var/tmp/mail.send and grant it “a+rw” rights; make the wrapper executable; rename old sendmail; and link it to the new wrapper: ~# touch…
-
How To Install Qmail-Remove
For more details on qmail-remove, you may refer to the link below. http://www.linuxmagic.com/opensource/qmail/qmail-remove 1. You have to install the gcc compiler + libraries yum install gcc gcc-c++ 2. Download qmail-remove. wget http://www.linuxmagic.com/opensource/qmail/qmail-remove/qmail-remove-0.95.tar.gz 3. Untar the downloaded file. tar -zxvf qmail-remove-0.95.tar.gz 4. Then do the following. cd qmail-remove-0.95 make make install cp qmail-remove /usr/bin/ mkdir /var/qmail/queue/yanked…
-
How to fix corrupted mails on queue in qmail or qmailtoaster.
Step 1. Download qfixq. wget http://qmail.jms1.net/scripts/qfixq Step 2. Change the file permission. chmod 700 qfixq Step 3. Stop qmail service. /etc/init.d/qmail stop Step 4. Run the script. ./qfixq After running it the first time to see what it’s going to do, you should run it a second time, in “live mode”. This will do the…
-
How to repair mail server configuration in Plesk?
Use mchk utility to repair/rebuild mail server configuration and restore settings for all mailboxes created in Parallels Plesk Panel. Plesk for Linux: ~# /usr/local/psa/admin/sbin/mchk –help Restore settings for all mailboxes. Usage: /usr/local/psa/admin/sbin/mchk [OPTION] OPTIONS: –without-spam restore all settings except for SpamAssassin configuration –with-spam restore all settings –spam-only restore only SpamAssassin settings ~# /usr/local/psa/admin/sbin/mchk –with-spam Plesk…