For the past few years, I have always worked my way up when it comes to setting up a web server instance. The trouble that comes with installing the LAMP stack, migrating your existing website to a new host among others is terrible.
For most beginners, this sounds familiar, setting up an instance on Alibaba cloud or any other cloud provider from scratch is nothing easy. You have to do some extra work such as researching “how to do this and this” which in most cases consumes a lot of time.
In this tutorial, I want to share my quick experience on how to set up and configure your Alibaba instance instantly. I normally use cPanel for this.
The beauty with cPanel is you get to interact with your instance from the graphical user perspective which is a lot easier for beginners. There is a lot you can achieve with having a cPanel on your instance but first let’s understand how cPanel works.
Some of the cPanel features include:
- Supports operations such as Backup, restore, migrations in a very easy and smooth way.
- Intuitive and powerful GUI to control your server with WHM
- Offers AutoSSL supporting proxy Subdomains.
- Allows you to view SSL in status in cPanel.
- Easy integration with PhpMyAdmin to manage your Databases from a web browser
- Supports unlimited user accounts, email and FTP accounts
- Supports SSL, disk quota, domain redirect, domain alias.
- Manage Domains, DNS, subdomains, MySQL, FTP and Email.
- Supports Rebranding
- Supports API Authentication tokens
Requirements & Prerequisites
- A freshly deployed Alibaba Cloud CentOS 7 server instance
- Minimum 1GB RAM (2 GB highly recommended)
- Minimum Disk Space of 20 GB (but 40GB recommended)
- A cPanel license
- Standard hostname (FQDN or Fully Qualified Domain Name)
- A non-root user with admin privileges set up on your server
- A static IP address of your server (for example 22.214.171.124)
Before installing cPanel, you’ll need to access your instance and make sure it meets the requirements specified in the section above. If you don’t follow the instructions below properly, you’re most likely to run into trouble.
Step by Step guide for cPanel Installation on alibaba instance
If you don’t have an instance deployed on your server, go to this article how to deploy an instance on alibaba cloud.Otherwise, in this guide i will use my freshly setup CentOS 7 server to demonstrate how to install cPanel.
Step 1: Install cPanel
The first command allows you to set up a standard hostname (Fully Qualified Domain Name — FQDN), It’s important to set up this if your server doesn’t have any. (For example, hostpc is my hostname and example.com my domain name — use your own details)
# hostnamectl set-hostname hostpc.example.com
Next, ensure you have Perl installed on your server, otherwise install it using the single command below.
# yum install perl
Install cURL command on your CentOS server. The command is an auto script installer that will help you download and install cPanel. Use the cURL command below.
# yum install curl
First install screen and wget: It can be useful in case you find out you may have issues with the irregular internet or you want to pause the installation process.
# yum install screen wget
Once the screen installation is complete, go ahead and start a new session. Use the command shown below.
Then download and install cPanel to home directory using command below.
# wget -N http://httpupdate.cPanel.net/latest
The single line of command above will change the current working directory to /home, then downloads the latest version from cPanel and execute the installation script as well. Enter Y to continue installation.
Then, enter the command below to start the script.
# sh latest
Note: The installation process takes approximately 1–2 hours depending on your server resources and internet connection speed.
You can now grab a cup of coffee or do something else as cPanel is installed on your server instance.
Your cPanel installation screen will look like something below after the installation process is complete.
After finishing the above task, the next step requires us to setup and configure the cPanel via web interface or Frontend. To understand this, just go through the step by step instructions below.
Step 2: Setup cPanel via web interface
- In your web browser URL bar, enter your IP address as shown below ( replace for server_ip with your server IP address) and press enter.
- Now login to cPanel using Root username and password. There are a few more steps to complete installation.
- Next, read the End User License Agreement and accept the terms by clicking on “I Agree? And continue to Step 2” button to proceed.
- In the Setup Networking section, provide your email address and contact in the fields Server contact Email Address and Server Contact SMS address respectively.
- cPanel uses the email address to send important notifications, alerts and other important information. Change the server’s hostname to the required name if not auto filled otherwise leave the rest set to default. You can as well use Google resolvers in the hostname section if you don’t have ISP’s resolvers.
- Next, proceed to select the Main Network/Ethernet Device. In this section, the available IP address of the device while be made the IP address of your server. Click “Save & Go to Set 5”.
- In this step, you’ll be required to setup your servers static IP address. Note if you have more than one IP address attached to your NIC Card, you may want to select the specific IP address from drop down and Tap “Go to Setup 4”
- In the following section, Add the A Entries for hostname and nameservers of your server. Add the nameservers in the empty fields e.g ns1.example.com/ns2.example.com
- In addition, you may add an entry for your hostname and name server by selecting the check box as shown below. Click “Save & Go to step 5”
- Now, setup different services like Cphulk, Mail & FTP. I recommend you select Pure-FTPD for the FTP configuration. Choose the disabled option if you want to only disable the local FTP server.
- In the same section, I recommend you select your Mail server that will be used for all your mailing activities in the future.
- Under Configure cPHulk Brute Force protection, enable this setting. cPHulk detects and blocks false password attacks activities and can also block their IP for your server. You can enable or disable the configurations as shown below.
- Lastly, you can now enable quotas which helps you to track down the disk space usages. Select “Use file system quotas” and click on “Finish setup wizard” to complete the Installation process.
Important to Note:
- If you don’t enable Use file system quotas, then you won’t be in position to monitor the amount of disk space used by any website on your hosting.
- Once you have installed cPanel on your CentOS server, you cannot remove it. You can only delete it by uninstalling your existing Operating System.
- cPanel is not free, it’s a commercial software. You require a license to work, however, there is a 14-day trial which is automatically activated on installation. You can install cPanel using the free version and later purchase the software.
- cPanel doesn’t support Ubuntu servers i.e ubuntu 14.04 or 16.04 etc. (at the time of writing this)
- Sometimes cPanel installer script is not able to update your license because of resolvers or Firewall. You can do it manually with single line of command below.
Once you’re done with each and every step in this guide, you can now access your WHM homepage which looks like something below. Remember you’ll be required to purchase a license of cPanel since the software is commercial.
cPanel is made for user level access and WHM is for root level access, as such you may need to create an account option in WHM. For my case I created a cPanel account with username root to show you the cPanel view for the root user.
Meanwhile you can access different features by typing their names in the search bar in the sidebar of the WHM homepage.
So I guess that’s all. In this article I have discussed how to install cPanel on your Alibaba instance on a CentOS 7 server and covered some initial steps how to configure your cPanel.