The webmaster's control panel
cPanel
Setting up a Linux server to host a website is a relatively trivial matter. Of course, I assume that the reader has some experience with Linux and understands the concepts of basic server administration. After all, you still need to install Apache to serve up a simple site. More complex sites requiring a database might demand MySQL or PostgreSQL as well. Let's not forget the P in the LAMP stack, PHP to round out a basic server's needed software.
Adding a second site to this server requires that you understand something about virtual hosts, but it's still relatively easy if you know what you are doing. But even a competent systems administrator can start feeling overworked if he or she needs to host a hundred sites, each with its own domain, a corresponding number of databases, and another thousand email accounts. Sure, you can still do it, but eventually, the job can daunt even the most accomplished systems administrator. That's where cPanel comes into play (see Figure 1).
cPanel (yes, it stands for Control Panel) and WHM (the Web Host Manager) provide a web-based graphical control panel designed for companies that provide hosting and email packages to their clients. WHM is a top-level administration interface that makes it possible to create accounts for both end users and resellers so that they, in turn, can administer their own domains via cPanel. Once an account (which can consist of one or more domains) is created, administration of that account can be delegated to the account holder. In that respect, WHM and cPanel are, at least to the hosting provider, one and the same, whereas cPanel is what the account holder sees.
The types of controls you can delegate include the creation of additional domains and subdomains, email accounts, FTP accounts, and so on. Account holders who have access to cPanel can keep track of their disk usage, bandwidth, and resource utilization in general. They can create email accounts, change passwords, manipulate databases, view website logs, add FTP users, create and download site backups, and a whole lot more. Another way to look at it is this: WHM is root.
Mini History Lesson
cPanel's pedigree is mixed, and it has an interesting history. Part of that history follows it to this day with people citing its rocky past, both in terms of ownership and of various problems with the product. That said, the modern WHM/cPanel package is an excellent, rock-solid package that any hosting provider should at least consider.
The biggest downside, from my perspective, is that it only supports FreeBSD, Red Hat Enterprise Linux, and CentOS. That said, many ISPs do provide servers running CentOS or Red Hat, and many offer cPanel and WHM as an option. A recent addition to cPanel's product line is Enkompass, essentially cPanel for users of Microsoft Windows Server products. Enkompass can manage multiple servers across an Active Directory domain. In this article, I will be focusing on the Linux-based WHM/cPanel offering [1].
Getting Started
Although cPanel can be licensed directly from cPanel Inc., most hosting providers get it from their ISP as an add-on to their dedicated host; I make that last distinction because WHM/cPanel is also supported in a variety of virtual system environments.
Using a web browser, you can access WHM and cPanel via pre-defined ports on your server. For instance, WHM is accessed via port 2086 using the root login:
http://yourhost.dom:2086
Also, you can use port 2087 for a secure login. Users accessing cPanel, on the other hand, use port 2082 with whatever username and password the administrator provided for their account. Similarly, port 2083 allows secure access to cPanel.
When you first login to WHM, you are presented with a number of icons representing some of the more common functions in WHM (see Figure 2 for a close-up). On the left-hand side, there's a rather long list of administration categories that cover server configuration, security, account and reseller functions, DNS configuration, backup, remote access functions, package management, database administration, daemon control, and pretty much anything else you might need to run a domain and web hosting service on your server.
Given the sheer number of options here, there's also a rather nice little search bar at the top (labeled Find). Just enter a few letters from the function you are trying to address; for example, enter acc for anything that might have the word account as part of it. This will narrow down the list to the things that currently interest you. Type update and the various update features of the WHM will become available. Now you might choose to roll your own custom versions of Apache and PHP to suit your environment (look for EasyApache) or update the system packages. Here, you can even update WHM and cPanel (see Figure 3).
Account Functions
The heart and raison d'Ítre of cPanel and WHM are the account functions. After all, you wouldn't be looking at something like cPanel and WHM if you weren't looking to resell hosting services. From the main menu, you can click the Account Functions icon to get a list of just about anything you can do with accounts (see Figure 4). There's also a second icon labeled Account Information, which contains reporting functions (list accounts, show bandwidth, etc.).
To create an account, click on Create a New Account, then enter the appropriate information. Each account has a user name and password associated with it; a strength meter and password generator are included to help you generate secure passwords (see Figure 5).
A little farther down the account creation screen, you'll find options for the panel theme, the locale (language), whether this is a reseller account (if this account can create other accounts), and so on. One rather interesting choice you need to make is the package you are selling your client (see Figure 6). To explain this, I'll back up to the side menu and tell you about packages.
When you offer hosting to a client, you invariably place limits on their site. These limits include things like maximum bandwidth, the amount of disk space, whether the client has shell access (SSH), the number of FTP accounts, the number of email accounts, the number of databases they can create, and more. All these things define a package, and the nature of the package usually has a lot to do with what you are willing to charge.
Additional settings on the account creation screen concern whether you are handling DNS functions and mail routing (you could be handling email on a separate server). Once you've entered all the information, click Create. A number of messages go flying by as the customer's account, cPanel implementation, and whatever features you are providing, including the directory structure, are all created. A report will follow on the screen, and that report will be emailed to you as well.
Once an account is created, you can turn over control of this account to the account holder. Or not. That is entirely up to you. One of the features you may offer your hosting clients is email, and setting up individual email accounts is very easy with cPanel. Once set up, users can connect to the same server but on port 2096 (or 2097 for a secure connection). Once logged in, users are presented with a variety of functions and different Webmail clients (see Figure 7). These include Roundcube, Horde, and Squirrelmail.
Besides working with the Webmail client of their choice, users can change their password, configure a forwarding address, set up an auto-response message when going on vacation, and so on.
Working with Databases
Many of today's websites aren't static affairs but dynamic beasts built on popular content management systems like Drupal or Joomla, blogging sites that use tools like WordPress, or CRM systems like SugarCRM or vtiger CRM. Countless tools make yesterday's static sites seem rather boring. Almost every one of these dynamic sites are built on the classic LAMP stack with a database (more often than not, MySQL) riding underneath. cPanel makes the creation and maintenance of databases relatively painless. My favorite "quick create" tool is the MySQL Database Wizard.
Four steps are involved in creating a database this way. The first is to give it a name. The next step is to create a user that will access this newly minted database (see Figure 8). Once again, you are provided with a password strength meter and a password generator.
When you click the Create User button, you'll move on to the third step, which involves defining the permissions granted to this user for this particular database. These permissions are the standard INSERT, UPDATE, ALTER, DROP, and so on that are familiar to anyone who works with MySQL. Permissions are granted by clicking on the check box that corresponds with the privilege in question (see Figure 9).
To give the user all of the normal privileges, you can click the ALL PRIVILEGES check box or simply select what your application will require from this user. Click Next Step, and the user will be created for you (step 4 merely completes the task). When it comes to setting up a MySQL database quickly, it doesn't get much easier than this.
For more complex tasks associated with the database, cPanel comes with phpMyAdmin, a complete web-based interface for working with MySQL data sets (see Figure 10). Many systems administrators will already be familiar with phpMyAdmin, which lets you do about everything you need to do when it comes to interfacing with MySQL. Import or export data, create tables, manipulate data, run queries, … ; you name it.
Look and Feel and a Little Handholding
This might seem rather minor, but so much of what people like about a graphical product is how the tools are presented. That usually means look and feel, or theme. cPanel comes with a variety of themes (or styles), so account holders can change the look and feel of their administrative interface (Figure 11).
Finally, although perhaps I should have started here, cPanel and WHM offer a great deal of handholding. From comprehensive online documentation, to quick tips, to video tutorials, cPanel is designed to let you learn as you use it. A great starting place is the Getting Started Wizard, which is offered as an option when you log in to cPanel for the first time.
Wrapping Up … Almost
Obviously, this is just a snapshot of what cPanel and WHM can do for you as a hosting provider. The scope of what cPanel and WHM covers would fill an entire book (yes, a few have been written).
As a long-time systems administrator, I admit to feeling a little uncomfortable with cPanel's point-and-click way of doing things, of the fact that it runs its own scripts and does things its own way, whether I like it or not. In fact, I didn't even want to look at cPanel at first because I assumed I could do it better. Although that might still be true, there comes a point when you realize that you can only manage so many things without a little help. cPanel is a mature, solid, and respectable helper for the overworked (and, of course, underpaid) systems administrator charged with the responsibilities of managing hosting accounts. I highly recommend it.
Open Source Alternatives
Although I've given a lot of coverage here to WHM and cPanel, I would nevertheless like to tell you about a few open source alternatives to WHM/cPanel.
I'll list a few in a moment, but be aware that almost all of them expect you to work "their way." In other words, you need to set up email their way or configure things their way (in that respect, they are no different from WHM and cPanel). Although that might be what you want, many systems administrators like their configuration files organized a certain way or want to name things a particular way, or use conventions that mean something to them specifically. There's also an argument that doing this stuff manually is how you really learn it. The GUIs and CHUIs out there make things simpler (sometimes), but you tend to stand some distance from what is really happening on your system.
On that note, check out my list of cPanel-like tools in Table 1.
Tabelle 1: cPanel-Like Tools
Tool |
Website |
---|---|
GNUPanel |
|
Easy Hosting Control Panel (EHCP) |
|
ISPConfig |
|
ispCPOmega |
|
GPLHost |
|
OpenPanel |
Some are better than others, and some are better maintained. However, as far as I know, all are currently maintained (even OpenPanel, which is the oldest without significant change, is still in development). ISPConfig (see Figure 12) is probably the most popular.
On the surface, they all share similarities with each other and with cPanel, although each one handles things differently under the hood. I have tried several of these tools, but it's hard to say which I think is "the best." The most important deciding factor might well be one of personal taste.
I can't really leave this discussion without mentioning Webmin (see Figure 13). Unlike WHM/cPanel and the others I've told you about here, Webmin is more of a system administrator's control center than a hosting panel. Webmin is really a kind of Swiss-Army-knife-style, do-it-all administrative interface that will work on pretty much any Unix-based system and, of course, pretty much any Linux distribution. Webmin is part of every major distribution's repository, so it's relatively easy to find and well worth checking out.
Webmin's many features are organized according to various categories, running down the left-hand sidebar. Each category controls a variety of systems, each handled by a module. In fact, all of Webmin's functions are modular, which means it's possible to upgrade Webmin as a whole or just a single module. Also, additional modules can be downloaded and added to Webmin.
WHM/cPanel certainly ranks among the most popular control panels for hosting providers, and many ISPs make cPanel available as an option, but there are always alternatives. These alternatives include both paid for, commercial packages, and free (as in speech and beer) open sources offerings.
In the end, you have to find something that works for you and, perhaps as importantly, works with you.