Check active connections to web server – DDOS solution

Here are few commands to check the active connection to apache or to any other web server, you can block IPs having too many connections :

Login to SSH and execute following commands with root access:

1.To see what IPs are connecting to server and how many connections exist from each IP:

netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

2.To see how many connections each IP on the server is receiving:

netstat -plan |grep :80 | awk '{print $4}' | cut -d: -f1 | sort | uniq -c | sort -n

3.Get total current active connections to Apache:

netstat -apn | grep :80 | wc -l

Get Apache status update from command line to see which domain is receiving maximum hits (cPanel/WHM server):

lynx http://localhost/whm-server-status

Read More

Update MySQL database for centos web panel

Here are simple steps to update MySQL database server 5.1 to MySQL database server 5.6 for Centos web panel:

Login to your server with root username and password from SSH:

1.  Create full database backup (In case mysql server break we have backup to restore).

mysqldump --events --all-databases | gzip > /home/alldatabases.sql.gz

2. Install Remi repo

cd /etc/yum.repos.d
wget http://rpms.famillecollet.com/enterprise/remi.repo

Read More

DDOS attacks on XMLRPC.php (Fixed)

wordpressXMLRPC.php is php file included with wordpress installation, it allows posting of content remotely through supported web blogs to wordpress blog, it provide many other features as well having many pros and cons. As far as web site security is concerned XMLRPC.php file is famous among hackers and attackers.

Most of the wordpress blogs get hits by attackers on XMLRPC.php usually called DDOS attacks. During the attack XMLRPC.php gets many requests and that makes web site goes down with excessive usage of allocated resources. Some web hosting providers suspend those accounts for high resource usage issues. Read More

Unable to install yum-rhn-plugin, please contact CloudLinux (Fix)

cloudlinuxFew days back i got error Unable to install yum-rhn-plugin, please contact CloudLinux support at https://helpdesk.cloudlinux.com  on one of our shared web hosting server while installing CloudLinux, I googled it but not able to found any proper solution, i have re-installed cPanel/WHM from scratch but no luck. This issue mostly appears on OVH Servers as they use their own cPanel/WHM and CentOS kernels which got few bugs in the repositories. I contacted cloudlinux support they provided me single command that fixed this issue immediately.

You can also run this command in SSH to fix out the repositories issue:

# rpm -e --nodeps libxml2-devel

Running up above command will fix this issue for sure as tested.

Read More

Enabling second level quotas on openVZ/virtuozzo/VPS

Many VPS hosting providers have quota issue with their VPS provided to customers, they always get complaints regarding the quotas especially on cPanel/WHM based servers. As cPanel/WHM based servers require File system quotas must be enabled to calculate Disk space usage for the hosted accounts and this very important to get this issue fixed in order to limit the disk space usage for any hosted account.installing cpanel/WHM

Following below instructions enables you to get this issue sorted if you have OpenVZ/Virtuozzo VPS you should follow these instructions to enable 2nd level-quotas support to get disk space usage issue sorted.

Lets start fixing this:

Login to your main node’s SSH with root access where you have hosted VPS’.

Just find out the exact ID of your VPS for which you want to enable the second level-quotas by executing below stated command:

# vzlist

It will list all the online Virtual Private Servers, remember the one you want to enable second level quotas for.

Now execute following below command on the required VPS ID.

# vzctl set VPS_ID --quotaugidlimit NUMBER --save

Read More