Follow us in our comprehensive tutorial on how to build your own WHM / cPanel cloud hosting on Amazon AWS EC2. This part takes less than 10 minutes and we will cover WHM installation process.

CLOUD HOSTING: DO IT YOURSELF

Build Your Own cPanel Cloud Hosting with Amazon AWS: Part 2

by Cloud Hosting Today

April 2, 2017

We have learned how to deploy cloud VPC on Amazon EC2 in first part of our Tutorial. Now it’s time to install WHM / cPanel on our cloud instance.

What are the advantages of cloud cPanel:

  • Run as many websites as you wish.
  • Create and manage cPanel accounts on your own.
  • Distribute resources between cPanel account  management.
  • Create and manage cPanel accounts to provide cloud web hosting services.
  • Create reseller cPanel accounts to earn more.




Step 1. Connect to your VPC (Virtual Private Cloud)
  1. Download Bitvise SSH Tunellier Client and install it.
  2. Launch Bitvise .
Manage the keys for your Cloud Instance.

3. Click on Client key manager button.

Remember that key pair you’ve downloaded in Step 22 of Part 1 of this tutorial? It’s time to use it in order to get SSH access to your cloud machine .

4. Click Import button to get your key pair imported in Bitvise.

Import a key pair to access your Amazon EC2 Instance.

5. As you remember you’ve named your key pair as vpc. Now find your vpc.pem and click it.

VPC Dashboard

6. Click Import again to get your key pair imported.

Importing key pair for your cloud EC2 Instance.

7. Once done, please close Bitvise key import tool.

Closing key import tool.

8. Now, go back to Amazon EC2 Dashboard and copy to clipboard (or just take a note of) the Elastic IP address of your VPC. Not sure about what is Elastic IP address? Please read Step 4 of Part 1 of this tutorial.

Copy Elastic IP address of your Amazon EC2 instance.

9. Paste (or just type in) your Elastic IP address in Host field of Bitvise Client.

10. Enter centos as Username.

11. Select publickey as Initial method.

12. Choose previously imported Client key.

13. And click Login button.

Log into your cloud Amazon EC2 instance.

14. Now wait for connection to establish and click Accept and Save button.  Once done, you will see a Terminal window.

 

Accept and Save host key for your Cloud Instance
Terminal window

Congratulations!

It’s a Terminal window. Now you are connected to your Amazon EC2 cloud instance via SSH. It’s time to get your WHM installed!

Looks scary? However, SSH is convenient and simple method to run commands on your cloud server. Don’t be afraid, we use it once for WHM installation only. There is a good chance that you’ll never need it again.

Now we run all the necessary commands for WHM /cPanel installation on your cloud server. WHM installation takes some time, so be patient.

Step 2. Install WHM

Enter this commands in exact order as shown below. 

  1. Type sudo su and press enter.
  2. Type yum install perl and press enter. Then, type y and press enter. Once again type y and press enter.
  3. Type sudo yum install wget and press enter. Then, type y and press enter.
  4. Type cd /home and press enter.
  5. Next, type wget -N http://httpupdate.cpanel.net/latest and press enter.
  6. Then type sh latest and press enter.
  7. Now, get yourself some coffee or tea, relax and wait 20 minutes for cPanel / WHM to install.
  8. You will get message once installation completed as shown on the illustration to the right.
  9. Next, type passwd root and press enter.
  10. Type the password you wish to use to login to your cloud WHM
  11. When finished, copy https address of your WHM cloud server as shown and paste it into address bar of your browser.
Installing cPanel / WHM on Amazon EC2 cloud server.

Now, you can close both terminal window and Bitvise Client.

It’s time to configure your cloud WHM. Next step of our tutorial will show you how to configure your server properly for cloud web hosting.

Cloud WHM login window

This is WHM welcome screen. Your username is root. Enter the password you have entered with passwd root command in previous step.

TIP: Some browsers might warn you about insecure connection. You don’t have to worry here, that happens because you don’t have SSL certificates installed yet. In that case, just click Advanced button and allow the connection.

Step 3. Configure WHM

Once logged in, please follow arrow tags in exact order as shown on the illustrations to the right.

  1. Here click I agree.
Agree with cPanel / WHM terms and conditions.

2. Enter your email in Server Contact Email Address field and scroll down to Hostname section.

Enter your Server Contact email

3. Enter your Hostname as show. Replace yourwebsite.com with name of your domain.

Set the Hostname of your cloud server

4. Leave Primary Resolver intact, while the Secondary set to 8.8.8.8

Set the Resolvers of your cloud server

5. Click Save & Go to Step 3.

Proceed to next step of WHM installation

6. Then click Go to Step 4.

Confirm your cloud server IP address

7. Leave all entries intact and click Save & Go to Step 5.

Confirm your cloud server Namesrevers and Hostname

8. Also confirm all settings here click Save & Go to Step 6.

Confirm your cloud server FTP and Perl settings

9. Flag Use file system quotas and click Finish Setup Wizard.

Use file system quotas for your cloud server.

10. Flag Enable PFP-FPM

11. And then click Save Settings.

Enable PHP-FPM for better performance of your cloud server.

12. TheWHM dashboard now is in front of you. Now it’s time to Reboot your cloud server

13. Now click Proceed button to gracefully reboot your cloud server.

Enable PHP-FPM for better performance of your cloud server.

Before the next step, please allow 60 seconds for your cloud server to restart.

Step 4. Configure cPanel account

Once server rebooted, you will have to login to your WHM again using your elastic IP address and the port 2087 (see Step 2.11): https://elastic_ip_address:2087

  1. Proceed to Account Functions > Create a new Account.
  2. Afterward, enter your domain name. In fact, that could be your website name.
  3. Next, pick a username for that cPanel account. For instance, your domain name is OK for that purpose.
  4. Then, enter a password you wish to use to login in that particular cPanel account.
  5. Confirm that password
  6. Enter an email address for password recovery and account notifications.
Start creating a new cPanel account

What if you need to host more than one website on your cloud server? In that case you will have to create a separate cPanel account for each of your websites accordingly. Do not worry, you won’t be charged for each cPanel account separately. Your WHM license covers unlimited cPanels account.

7. Afterwards, scroll down to Mai Routing Settings and set them to Automatically Detect.

8. Then click Create button.

Select t2.small Instance.

Your cPanel account will be created in a seconds and you will get Account Completion Compete message.  Your cPanel license  will be free of charge for first month! Accordingly, you may consider purchasing WHM & cPanel license for your cloud server once your free trial expires.

Once your cPanel account is created it’s time to point your domain NS records to your cloud server. You can do that in your domain registrar account, for instance.

Just set NS records to your Elastic IP address and allow up to 24 hours for DNS to propagate. Fortunately, that happens much faster, so you will be to access your website in 10-15 minutes or so.

What are NS records? In simple words they are the instructions on where to direct your website visitors. Once you set them to Elastic IP address of your cloud server, each and every user will directed there.

Moreover, you can take an advantage on cloud technology to direct your website visitors to the cloud server through additional layer of security. At this point, we recommend Cloudflare for that purpose.

Additionally, that approach can make your website much faster and the traffic more manageable. We will cover this cloud solution in our next article.