frame

My Experience With Working on cPanel Hosting

edited June 18 in Writings

cPanel! cPanle!! cPanel!!! Na 3 whole times I call thy name. The Almighty and Invincible cPanel, created by the gods of programming for mere mortals.
I have to salute cPanel like that because you see, many people have made cPanel their GOD so to speak. They have come to believe that when you talk of hosting a website, you are talking of cPanel automatically.
These set of people, if you give them a cloud server where you can only control the server via SSH or give them stuffs like AWS CLI, they will simple faint dead.

But we get ahead of ourselves, for our talk today has to be on cPanel. I have worked extensively on cPanel for the past (quickly launch calculator app, closes it again) since around year 2004 (do the sums yourself), and I have had a lot of experiences with it, good, bad and ugly.

Let us start by trying to explain what cPanel is:

If you go to wikipedia or google and search you will get something like this:
cPanel is the company that builds cPanel & WHM. cPanel & WHM is an online Linux-based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site to the website owner or the "end user".

But to most typical web-designers, cPanel is that stuff that the web-hosting people send to you when you buy hosting from them, and you use it to upload your website online. Dont laugh, but that is the definition that many people will tell you (because cPanel is their gods, they dont know that their are other bigger gods out there like AWS) that can do the same thing.

Now that we know what cPanel is (at least a good idea), people that use cPanel fall into 3 distinct categories (my own classification mind you):
Class 1 : people that purchase a single host from a reseller account
Class 2: people using a reseller account
Class 3: people using a personal vps
Class 4: people using a dedicated server

Now, the class you fall into determines a whole lot of things here for class 1 is the lowest and class 4 is the highest.

Class 1: yeah you can host your website but your entire setup is based on what the resller configures for you. Your reseller may allow you make use of only php 5.5 and you need to start calling for upgrade.
Class 2: reseller is like king to class 1, yet the reseller may not own the server (vps/dedicated) and so has a lot of limits to the configuration and what can be done
Class 3: with VPS you are a chief, because you can do and undergo. I have once configured a VPS with NODE.JS, PHP, PYTHON e.t.c thinking I was a King, but I was quickly dethroned from that thought because a VPS has a great limit as well.
Class 4: Now you are King because this is a more powerful alternative than VPS. Though to a lay person, you have control like VPS but dedicated is always the best choice at the end of the day.

Now that I have breezed from class 1 to class 4 in a compressed manner (for my statements are highly compressed there), we must talk about cost and scaling. The cost of server is lowest in class 1 and highest in class 4.

When you are just starting out your business, you may not need beyond a regular shared hosting on class 1, but as your traffic and demands increase you will gradually find yourself in class 3 or class 4 depending on how quickly your business grows.

Now that we have done the introductory path, we shall be delving into the more technical part on my next post, where we shall be talking about:

  • Types of servers where cPanel is hosted on, and how this affects you. cPanel on Centos 7 and cPanel on Debian 9 are not exactly the same thing and there is a reason why you should care.
  • How do you control your cPanel from local pc e.g. ssh, ftp, sftp
  • What about SSL? Free and Paid SSL

Comments

  • This is a very good one. I just buy naija hosting cpanel and upload my websites. I dont know there is more to it o.

  • nice article, best thing read today

  • The Last time I tried to SSH a Shared hosting, I saw that it was a scam. Am still looking for a reseller acct that allow ssh

  • @jenny said:
    This is a very good one. I just buy naija hosting cpanel and upload my websites. I dont know there is more to it o.

    Thanks friend.

    @goodmuyis said:
    The Last time I tried to SSH a Shared hosting, I saw that it was a scam. Am still looking for a reseller acct that allow ssh

    You are highly correct, one of the best I used however was namecheap SSL. But you see, as long as it is shared you are still operating on a low-level and need to step up.

    I apologise for the diversion, I was fixing the SSO on the home-page so that it can work with the forum properly. And now I think it does.

    Back to our Almighty cPanel:

    One of the problems we usually face sometimes on cPanel is the public_html.

    Let me try to explain some of the HAZARDS of this public_html.

    Let us say you buy a cpanel hosting, and your username e.g. kate and your domain is kate.com
    So what you will get is that when you open your file manager, you will see something like:
    /home/kate/public_html

    Now when you upload a file e.g. index.html into the public_html folder, you can access it via:
    http://kate.com/index.html

    That is pretty simple eh?

    Now, let us say you decide to create a subdomain called e.g. music
    So you will have http://music.kate.com
    Most times, cPanel will give you something like this:
    /home/kate/public_html/music
    In most instances unless you tweak settings, you cant move out of the public_html

    Now here is how that is a problem, it will also mean that a person can decide to access your website via:
    http://kate.com/music instead of only http://music.kate.com because your files are in the public_html folder.

    But if you are a reseller or own your VPS, you can go to your tweak settings and configure it such that you can have
    /home/music.kate.com

    Notice that the subdomain has moved away from the public_html, this means you can only access it with music.kate.com and kate.com/music will no longer work.

    If you can access the subdomain via the /music their are some security flaws that can be used to hack your website. It is always best to control your primary means of access and secure it. A city should not have multiple gates where the gates are not guarded.
    But security is beyond the scope of this at this time, maybe another thread will deal with that.

    Addon Domains
    If you have not tweaked your settings on cpanel, your addon domains may reside in your public_html folder and will be open to similar flaws as above

    What if you want to change the public_html of your primary domain
    For example, let us say kate.com is a laravel installation, and for safety it is always advised to keep your files away from public eyes, so you will want to do something like:
    point your kate.com to /home/kate/kate.com/public

    So that you can put your laravel stuffs inside the kate.com folder and put the index file and .htaccess inside your public folder as required. That way there is no direct way anyone can access your app, resources folder.

    This is one reason why some people go for nginx server rather than apache.

    cPanel Hosting Operating System
    I spoke earlier about the need to be concerned about the operating system your cpanel is running on. Well, you see cPanel is just a software and it is installed like every other software.

    You can install PHP on windows, or Mac or Linux. It is the same PHP right? but different operating systems. So too it is with cPanel.

    When you need to run SSH commands, you will need to know the operating system you are targeting.

    Now we are just about warming up. all this is just an introductory something. We will soon be approaching the more practical sections where we get to see screen-shots and learn some real lessons too.

  • Following Bumpa2Bumpa

  • No be only you o, we plenty wey dey follow.

  • Nice one and an interesting read.

  • All this thing just be like Chinese to me

    God when??????

  • Nice writeup!

  • This article is so nice

  • Thanks people, we are by no means done. I am doing a system upgrade, once I finish this I will be back to continue the part 2 of this - practicals.

  • Hi Jenny, any issues again with cpanel?

  • Welcome back

  • thank you o jare.

Sign In or Register to comment.

Africoders

© Africoders 2014 - 2019, All rights reserved. You will also find Africoders on FreeBasics.

Get In Touch