QuickFix

More Technical Help

Thursday, May 19, 2011

cPanel Installation

CPanel installation is quite easy:

1) Login to the server with root access

2) wget http://layer1.cpanel.net/latest

3)sh latest

After this slow down your back on chair comfortably as the installation will take 30-45 min. You can watach the installation if any error occured.

CSF Installlation on cPanel Server

Installation is quite straightforward:

Login as the root user to SSH and run the following commands.
rm -fv csf.tgz
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

If you would like to disable APF+BFD (which you will need to do if you have
them installed otherwise they will conflict horribly):
sh disable_apf_bfd.sh
That's it. You can then configure csf and lfd in WHM, or edit the files
directly in /etc/csf/*

Installation Completed
Don't forget to:
1. Configure the TCP_IN, TCP_OUT, UDP_IN and UDP_OUT options in the csf configuration to suite your server
2. Restart csf and lfd
3. Set TESTING to 0 once you're happy with the firewall
csf is preconfigured to work on a cPanel server with all the standard cPanel
ports open. It also auto-configures your SSH port if it's non-standard on
installation.
You should ensure that kernel logging daemon (klogd) is enabled. Typically, VPS
servers have this disabled and you should check /etc/init.d/syslog and make
sure that any klogd lines are not commented out. If you change the file,
remember to restart syslog.
Now - login to your cPanel server's WHM as root and go to the bottom left menu. If already logged in then reload the page. In Plugins - you will see:  ConfigServer Security&Firewall
The firewall is STOPPED by default - it is not running. We need to configured it, and then take it out of Test Mode.

Click on Firewall Configuration

ETH_DEVICE =: Set this to eth+

TCP_IN/TCP_OUT/UDP_IN/UDP_OUT = : These are the ports you want to leave open for your server to operate. If you change the default SSH port make sure to add it here. Also add any other services you might have running such as Shoutcast or game servers. By default most of the ports used should already be configured.


MONOLITHIC_KERNEL = : 0 Only change this to 1 if your firewall will not start - otherwise leave it as it.


LF_DSHIELD = 0: Change this option to 86400. This is an automatic updated list of known attacking IPs. Enabling this will stop them from being able to connect to your server.

Spam Protection AlertsIf you want to add some spam protection, CSF can help. Look in the configuraiton for the following:

LF_SCRIPT_ALERT = 0 change this to 1. This will send an email alert to the system administrator when the limit configured below is reached within an hour.

LF_SCRIPT_LIMIT = 100 change this to 250. This will alert you when any scripts sends out 250 email messages in an hour.


Configuration Complete - AlmostScroll down to the bottom and click on Change to save the settings. Then click Restart csf+lfd

You should see a big page of ACCEPT and near the bottom you should see:

csf: TESTING mode is enabled - don't forget to disable it in the configuration
Starting lfd:[  OK  ]
Click on Return

Now TEST all your services to make sure everything is working - SSH, FTP, http. After you do a few quick tests go back into the Firewall Configuration page.
TESTING = 1 change this to 0 and click Change at the bottom. Then Restart csf+lfd


That's it, the firewall is successfully installed and running!!
Firewall Status: Running - you should see this on the main CSF page in WHM.

Sunday, May 8, 2011

Track Top memory and CPU consuming process


Use below mentioned command to get top memory consuming processes"

ps aux | head -1;ps aux --no-headers| sort -rn +3 | head

Use below command to get top cpu consuming processes:

ps aux | head -1;ps aux --no-headers | sort -rn +2 |more

Catching spammer on cpanel server

If mass mailing or spamming is going on cPanel server then you can trace the spammer with follwoing commands:

1 ) pidof exim

2) Belwo command will show you the no of emails sent by perticular domain:

exim -bp | exiqsumm | more
3)
exim -bpr | grep "<*@*>" | awk '{print $4}'|grep -v "<>" | sort | uniq -c | sort -n
That will show you the maximum no of email currently in the mail queue have from or to the email address in the mail queue with exact figure.


4)

exim -bpr | grep "<*@*>" | awk '{print $4}'|grep -v "<>" |awk -F "@" '{ print $2}' | sort | uniq -c | sort -n
That will show you the maximum no of email currently in the mail queue have for the domain or from the domain with number.


5)

Check if any php script is causing the mass mailing with
cd /var/spool/exim/input
egrep "X-PHP-Script" * -R
Just cat the ID that you get and you will be able to check which script is here causing problem for you.


Exim Server Commands

How to check emails in mail queue?

exim -bpc

How to check full status of exim server?

eximstats -nr -ne /var/log/exim_mainlog

How to check exim pids running?
pidof exim
 
How to check frozen emails?

 exim -bpr | grep frozen | wc -l


How to delete frozen emails?

exiqgrep -z -i | xargs exim -Mrm


How to check mails sent per domain?

exim -bp | exiqsumm | more


 
 
 

Tuesday, May 3, 2011

Your license could not be activated : License File Expired

I had a issue with cPanel license as I was getting the error "Your license could not be activated"

Solution >>

I tried
/usr/local/cpanel/cpkeyclt
but the issue didn't get resolve. then I cheked the date on the sever and found that very old date was set on the server. Simply I sync the date with the command :

rdate -s rdate.cpanel.net


The issue got resolved.

Saturday, April 30, 2011

What is Cron

Cron is a unix, solaris utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon

Crontab Commands :

crontab -e    Edit your crontab file, or create one if it doesn’t already exist.
crontab -l      Display your crontab file.
crontab -r      Remove your crontab file.