We do support Round the Clock 24 x 7 x 365 (+91) 883 012 3924
header-image

L3 Web Hosting Blog

cPanel, Plesk, Wordpress Hosting SSD disk

Check out L3WebHosting blog for tips and in-depth articles on web hosting services !!

Installing CloudLinux on CentOS cPanel server


First, you will need to get activation key or an IP-based license or you can use 30-days trial key.
You will need to have root level access in order to proceed further :

$ wget https://repo.cloudlinux.com/cloudlinux/sources/cln/cldeploy

$ sh cldeploy -k # if you have activation key

OR

$ sh cldeploy -i # if you have IP based license

$ reboot

Once the installation is completed, the server needs to be rebooted.

Please do contact us at esupport@L3webhosting.com if you require any further assistance.

Install or Update PostgreSQL on Your cPanel Server


Use below steps to install or upgrade PostgreSQL on your cPanel server :

1) Run the /usr/local/cpanel/scripts/installpostgres command to install or upgrade PostgreSQL
2) Access WHM >> Home >> SQL Services >> Configure PostgreSQL
3) Click on Install Config if PostgreSQL does not exist on your server
4) Click Create Users to add current cPanel users to PostgreSQL
5) Enter Password and click Change Password button
6) Import your databases

psql dbname < BackupDump.sql

How to Disable Network Manager


While installating cPanel WHM you will receive below error :

2018-08-08 06:22:03 166 ( INFO): cPanel & WHM installation started
2018-08-08 06:22:03 165 ( INFO): This installation will require 20-50 minutes, depending on your hardware.
2018-08-08 06:22:03 166 ( INFO): Now is the time to go get another cup of coffee/jolt.
2018-08-08 06:22:03 162 ( INFO): The install will log to the /var/log/cpanel-install.log file.
2018-08-08 06:22:03 161 ( INFO):
2018-08-08 06:22:03 169 ( INFO): Beginning Installation v1…
2018-08-08 06:22:03 656 ( INFO): CentOS 7 (Linux) detected!
2018-08-08 06:22:03 620 ( INFO): Checking RAM now…
2018-08-08 06:22:03 511 ( INFO): Validating that the system hostname (‘-information hidden’) is a FQDN…
2018-08-08 06:22:03 555 ( INFO): Checking for NetworkManager now…
2018-08-08 06:22:03 521 (ERROR): ********************* ERROR *********************
2018-08-08 06:22:03 526 (ERROR): NetworkManager is installed and running, or
2018-08-08 06:22:03 525 (ERROR): configured to startup.
2018-08-08 06:22:03 526 (ERROR):
2018-08-08 06:22:03 522 (ERROR): cPanel does not support NetworkManager enabled
2018-08-08 06:22:03 521 (ERROR): systems. The installation cannot proceed.
2018-08-08 06:22:03 529 (ERROR):
2018-08-08 06:22:03 510 (ERROR): Please consult your system documentation to
2018-08-08 06:22:03 511 (ERROR): remove NetworkManager, replacing it with the
2018-08-08 06:22:03 512 (ERROR): network.service
2018-08-08 06:22:03 511 (ERROR): ********************* ERROR *********************
2018-08-08 06:22:03 516 (FATAL): Exiting…
Removing /root/installer.lock.

Before you install cPanel/WHM on Centos server you will need to disable the Network Manager service and enable the network.service service.

1) Disable Network Manager with the following commands:
# Disable NetworkManager on CentOS 6, CloudLinux 6, Red Hat Enterprise Linux 6 (RHEL), or Amazon Linux

service NetworkManager stop
chkconfig NetworkManager off

# Disable NetworkManager on CentOS 7, CloudLinux 7, or RHEL 7

systemctl stop NetworkManager.service
systemctl disable NetworkManager.service

2) Open /etc/sysconfig/network-scripts/ifcfg-eth0 and set below values :

NM_CONTROLLED=no
ONBOOT=yes

3) Restart network service
# Restart the network on CentOS 6, CloudLinux 6, RHEL 6, or Amazon Linux

chkconfig network on
service network start

# Restart the network on CentOS 7, CloudLinux 7, or RHEL 7

systemctl enable network.service
systemctl start network.service

How to Install DirectAdmin CentOS

Install DirectAdmin on CentOS

# To install DirectAdmin, you need to enter below command on shell with root user :

yum update -y
yum install gcc-c++ gcc automake -y
yum install make
yum install flex

# Download DirectAdmin setup script and run it :

wget http://directadmin.com/setup.sh
chmod +x setup.sh

./setup.sh

# DirectAdmin setup has a few more things which you will need to fill

Please enter your Client ID :
Please enter your License ID :
Please enter your hostname \(server.domain.com\)
It must be a Fully Qualified Domain Name
Do *not* use a domain you plan on using for the hostname:
eg. don’t use domain.com. Use server.domain.com instead.
Do not enter http:// or www
Enter your hostname (FQDN) :
Is this correct? (y,n) :
Is eth0 your network adaptor with the license IP? (y,n) :
Is xx.xx.xx.xx the IP in your license? (y,n) :

DirectAdmin will now be installed on: Centos 7
Is this correct? (must match license) (y,n) :

Zipping and Unzipping Files on Linux server

Zip, Gz, Tar, bzip2 are compression and file packaging utility on Linux server.

# To Create zip file :

$zip myfiles.zip Foldername FileName

# To extract zip file :

$ unzip myfiles.zip

# Without unzipping .zip file you can View the contents of *.zip file

unzip -l jasper.zip

# Create a new tar archive

tar cvf myfiles.tar Myfolder/

# Extract from an existing tar archive file.

tar xvf myfiles.tar

# Create a *.gz compressed file:

gzip myfiles

# To uncompress a *.gz file:

gzip -d myfiles.gz

# create a *.bz2 compressed file:

bzip2 test.txt

# To uncompress a *.bz2 file:

bzip2 -d test.txt.bz2

How to change my document root folder using an .htaccess file

By default, files of your primary website are loaded from public_html folder.

If you want to load website’s files from Sub Folder instead of public_html folder and do not want Sub Folder name to be appeared as a part of the URL of your website then this post is for you 🙂

You need to add below code into /public_html/.htaccess file :

RewriteEngine on
RewriteCond %{HTTP_HOST} ^YourDomain.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www.YourDomain.com$
RewriteCond %{REQUEST_URI} !SubFolder/
RewriteRule (.*) /SubFolder/$1 [L]

// Replace "YourDomain.com" with your actual Domain Name
// Replace "SubFolder" with your Sub Folder name

Please do contact us at esupport@L3webhosting.com if you require any further assistance.

How to redirect www URLs to non-www

You can redirect http://www.yourdomain.com to http://yourdomain.com by setting below code into .htaccess file.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC] RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

// Replace yourdomain.com with your actual domain/website name.

Please do contact us at esupport@L3webhosting.com if you require any further assistance.

How to redirect non-www URLs to www

You can redirect http://yourdomain.com to http://www.yourdomain.com by setting below code into .htaccess file.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]

// Replace yourdomain.com with your actual domain/website name.

Please do contact us at esupport@L3webhosting.com if you require any further assistance.

How to reset SSH port from WHM

There is an Auto fixer script available to reset the SSH port through WHM.

# Log into WHM control panel with root user.
# Access the following URL to reset SSH configuration settings to default:

http://ServerIPAddress:2086/scripts2/doautofixer?autofix=safesshrestart

// Replace "ServerIPAddress" with your server IP address or hostname.

After executing this script, SSH Port of your server will be reset to its default value which is 22 port.
Now you can access ssh with default port 22.

Please do contact us at esupport@L3webhosting.com if you require any further assistance.