Need help Setting up cPanel on an AWS instance? We can assist you.
Here at Bobcares, we often handle requests from our customers with similar queries as a part of our AWS Support Services.
Today, we will see steps followed by our support engineers in setting up cPanel.
How to setup cPanel on an AWS instance?
Let us discuss about the steps followed by our Support Techs.
1.Setup VPC (Virtual Private Cloud)
- Firstly, login to your AWS web console and navigate to below location for creating VPC (Virtual Private Cloud) for your cPanel infrastructure.
Services >> Networking >> VPC (VPC Dashboard)
- Then, click on Start VPC Wizard button.
- Next, select VPC with a Single Public Subnet.
- Input your CIDR and Public Subnet.
2.Create EC2 Instance
Then, go to EC2 instances section of AWS console and start creating a new instance of your choice using the following steps.
Please note cPanel/WHM supports only CentOS, RedHat and CloudLinux operating systems.
- Firstly, select an Amazon Machine Image (AMI)
- Then, select an Instance Type
- Configure Instance Details
- Add Storage of your preferred size
- Finally, tag your Instance Name
3.Attach a static IP address to your cPanel & WHM instance
- By default dynamic public IP address attached to your instance and it changes every time you stop and start the instance.
To avoid that create a static IP address, and attach it to your instance.
So that when you use your domain name with your instance, you don’t have to update your domain’s DNS records each time you stop and start the instance. Or if your instance fails, you can restore your instance from a backup and reassign your static IP to your new instance.
- You must specify the public IP address of your cPanel & WHM instance when purchasing a license from cPanel.
The license that you purchase is associated to the IP address of your instance.
- Specify your static IP when you purchase a license from cPanel, and keep your static IP for as long as you plan to use your cPanel & WHM license with a Lightsail instance.
- If you need to transfer your license to another IP address later, you can submit a request to cPanel.
On your instance management page, under the Networking tab, choose Create static IP, then follow the instructions on the page.
4.Login to Server and Update
- Login to Server as root user using pem file generated during instance creation.
ssh -i server.pem root@IP_addres
- Update all packages on your system using following commands
yum update
- Reboot instance.
reboot
5.Setup Hostname
- Use below command to set a hostname temporarily on you rsystem.
# hostname cpanel.example.com
- Now make changes permanent by the editing configuration file.
- Edit /etc/sysconfig/network configuration file for RHEL & CentOS
HOSTNAME=cpanel.example.com
- For Ubuntu and Debian systems edit /etc/hostname and enter hostname there
cpanel.example.com
- Now edit /etc/hosts for binding hostname with local system ip.
10.0.0.100 cpanel.example.com
6.Install cPanel & WHM
Use the following commands to complete the installation. This process will take time as per your network speed and system configuration.
cd /home
yum install wget
wget -N http://httpupdate.cpanel.net/latest
sh latest
7.Setup NAT
- Sometimes the system doesn’t automatically detect NAT on your instance. Then you can run below command to do it manually.
/scripts/build_cpnat
[output]
info [build_cpnat] 172.32.121.55 => 54.6.169.157
- Now Navigate to Home >> Server Configuration >> Basic cPanel & WHM Setup in your WHM and check for The IPv4 address to use to set up shared IPv4 virtual hosts shoud show your public ip address.
8.Open Ports in Security Group
Finally, open all inbound ports in the AWS security group used by the instance or open specific ports for inbound network.
[Need help with AWS setup? We’d be happy to help you]
Conclusion
In short, today we discussed about the steps followed by our Support Techs in Setting up cPanel on an AWS instance.
0 Comments