Posts Under Category: Tutorials

The current stable version of CentOS Linux OS is 6.5
If you want to upgrade your VPS / dedicated server to CentOS 6.5 from 6.4/6.3, follow below steps.
read more

In this tutorial, I will explain how to install Nginx on a CentOS server / VPS. This is very easy and will not take more than 5 minutes.

Before starting installation of Nginx, make sure you have installed PHP and MySQL
How to install PHP
How to install MySQL

Login to your server via SSH and as root.

Step 1:

If you have already installed Apache and is running, stop Apache.

service httpd stop

Step 2:

Create nginx repo file.

touch /etc/yum.repos.d/nginx.repo

Step 3

Edit nginx repo file.

nano /etc/yum.repos.d/nginx.repo

And add following code. Save the file.

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

Step 4

Install Nginx

yum install nginx

Step 5

Start Nginx

service nginx start

Step 6

Make nginx auto start on server reboot.

sudo chkconfig nginx on

Done!!

Default Web Directory

This is the default folder / directory of Nginx server. You should upload your website files in this directory.

/usr/share/nginx/html

read more

I was recently installing and configuring a new server. After installing CentOS I installed Apache. But server IP was not opening default Apache page. I was getting ping reply from my computer to server IP. So, I quickly figured out that Port 80 and Port 224 on server are blocked for incoming web traffic.

we need to open port 80 (http port) and port 443 (SSL / https port) for web traffic. So, here is how you can open port 80 and 443 on your server.

Login to your server as root via SSH and run following commands:

iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart

Done!!!

Our Recommended VPS Hosting

You can protect your server from XMAS Attacks and drop incoming malformed XMAS packets by applying following rule in IPTable.

Login to your server via SSH as root and run following commands:

iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
/etc/init.d/iptables save
/etc/init.d/iptables restart

Done!!

read more

Syn-flood attacks are common these days. Syn-flood attack means that the attackers open a new connection to the server, but do not state what they want. They just want to take up servers resources and increase server load.

This type of attack can be controlled by adding a rule in IPTable to reject syn-flood attacks. Login to your server as root via SSH, and run following commands:
read more

For security reason, you should block all incoming null packets requests to your server. All TCP requests with flag NONE to your server should be blocked. These are generally bad bots looking for security holes on your server to exploit. This can be easily done by adding a rule in IPTable / firewall.

Login to your server as root via SSH and run following command:

iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
sudo /etc/init.d/iptables save
sudo /etc/init.d/iptables restart

This works on a CentOS / RedHat Linux server.

Our Recommended VPS Hosting

In this tutorial, I will explain how to install cPanel on a new Linux server with CentOS installed on server.

Step 1:

Before installing cPanel, make sure you have a cPanel license for your VPS. If you do not have cPanel license, you can get a free 15-days trail license. It will take hardly 1-minute to get a 15-days trail licence.
Get cPanel 15-Days Trail Licence
read more

Let’s say we want to search for text lophost in file /var/log/messages
We can do this using command grep. Login to your server via SSH and run following command

grep lophost /var/log/messages

read more

On a Linux server you can rename a file using mv command.
Let say you want to rename file-one.txt to file-two.txt
Use following command for this.

mv file-one.txt file-two.txt

Another example. Suppose we want to rename ravi.txt to lophost.txt located in /var

mv /var/ravi.txt /var/lophost.txt

read more

If Apache / HTTPS is using lots of memory on your server, here is how you can optimize Apache on your server / VPS.
Login as root in WHM and navigate to:

WHM Home >> Service Configuration >> Apache Configuration >> Global Configuration

And change value of Max Connections Per Child. Default value of Max Connections Per Child is 10,000
You should reduce this value to 1000. This will greatly reduce memory usage by Apache on your server.

Our Recommended VPS Hosting