Posts Under Category: Tutorials

In this tutorial, I will explain how to update cPanel License key of a server / vps. cPanel license key can be updated from SSH. You need to update your server license key when you have a new licence key, or you want to upgrade from trail version to paid version.

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

/usr/local/cpanel/cpkeyclt

Done!!

Now try to login in WHM using URL: http://server-ip:2086 OR http://server-ip/whm

Our Recommended VPS Hosting

If you want to see CPU details of your Linux server / VPS, here is how you can check.
Login to your server as root and via SSH, and run following command:

cat /proc/cpuinfo

This will show you your server CPU details like Total processors, CPU model number, speed, cache.

Our Recommended VPS Hosting

Using below commands you can start, stop and restart MySQL from SSH.
Login to your server as root via SSH, and run following commands.

Start MySQL

service mysql start

OR

/etc/init.d/mysql start

Stop MySQL

service mysql stop

OR

/etc/init.d/mysql stop

Restart MySQL

service mysql restart

OR

/etc/init.d/mysql restart

Status of MySQL

If you want to know the status of MySQL on your server, run below command.

service mysql status

read more

Use following command to know the hostname of your server.

hostname

You should run above command in SSH as root user.

Our Recommended VPS Hosting

If you want to check how much disk space your server has, how much disk has been used and how much free disk space is left on your Linux server, here is simple command for that.

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

df -h

This will show size, Used, Available, File system mount points.

If you want to check disk usage summery of any particular directory, say /home use below command:

df -h /home

Our Recommended VPS Hosting

If you want to see the list of users who are logged in server and their IP and what they are doing, here is how you can do.

Login to your server as root and run following command.

w

OR

who

Above command will list all logged in users, their IP, what they are doing.

Our Recommended VPS Hosting

If for some reason you do not want to update your server kernel but want to update other packages running on CentOS, here is how you can do.

Update can be done using yum command and to exclude kernel from update we need to add exclude command.
Login to your server as root via SSH and run following command:

yum -y --exclude=kernel\* update

OR

yum -y -x 'kernel*' update

Above command will update all packages but will leave kernel update on a CentOS server.

Our Recommended VPS Hosting

For security reason, it is recommended that you disable directory listings / indexing on your server. Apache default configuration comes with this feature enabled but its always a good idea to get it disabled unless you really need it.

When this option is enabled, user can see the list of files / folder of a directory when no index file is present.
apache-directory-index

With Apache listings / indexing option disabled, user will not be able to see content of a directory in absence of a index file.

Here is how you can disable this on a cPanel server.

Step 1

Login to your server WHM as root.

Step 2

Navigate to:
WHM Main >> Service Configuration >> Apache Configuration >> Global Configuration

Step 3

Under Directory ‘/’ Options >> uncheck Indexes >> Save >> Restart Apache

apache-directory-index-2

Done!!

Our Recommended VPS Hosting

You have moved your WordPress website to a new server / hosting provider, and all pages on your WordPress website are giving 404 page not found error. This solution may fix your problem.

Login in WordPress Admin Dashaboard and navigate to:

Settings >> Permalink

And click Save changes button with same settings.
Check your website now. That should solve your problem.

Our Recommended Hosting

This tutorial explains how you can start and stop firewall on a CentOS / RedHat Linux server.

How to Stop / Disable firewall

Below commands will stop / disable firewall of a redhat / centos server. Login to your server as root via SSH and run following commands:

service iptables save
service iptables stop
chkconfig iptables off

For IPv6 firewall, use below commands:

service ip6tables save
service ip6tables stop
chkconfig ip6tables off

How to start firewall

Run below commands to start firewall.

chkconfig iptables on
service iptables start

For IPv6 firewall, use below commands:

chkconfig ip6tables on
service ip6tables start

Our Recommended VPS Hosting