How to call SOAP api from PHP

This tutorial explains calling of SOAP API with PHP code, there is also work around for the problems while accessing host URL.

This code is tested with PHP 5.6.x version and is working without any issue.

Create PHP file and paste following below code in it, save and you’re done.
In below code we are calling SMS SOAP API to send SMS’.
Read More

Redirect old domain to new domain with 301

Here are the few lines of code you can add into your .htaccess to redirect your old domain to new domain with 301 (permanent redirect) code.

Open .htaccess file in any editor and add following below lines, please replace with your own domain.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^ [NC,OR]
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301,NC]


That’s all 🙂

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

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