{"id":50625,"date":"2018-10-09T13:00:00","date_gmt":"2018-10-09T18:00:00","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=50625"},"modified":"2018-10-09T13:00:00","modified_gmt":"2018-10-09T18:00:00","slug":"how-to-build-a-cpanel-hosting-environment-on-amazon-aws","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-build-a-cpanel-hosting-environment-on-amazon-aws\/","title":{"rendered":"Building cPanel Web Hosting on Amazon AWS"},"content":{"rendered":"
Let\u2019s say you need to find hosting for multiple web applications with cPanel backend access so clients cannot access each other\u2019s backends. What can you do to create a secure hosting environment without paying for several different hosting accounts?<\/span><\/p>\n Why not host it yourself?!<\/span><\/p>\n Disclaimer<\/span><\/strong>: If you have one or two lightweight websites, this probably isn\u2019t the most cost-effective route to go. However, if you are currently paying to host several websites and have some technical background, hosting a site yourself may be a great route to consider. So stick around, and we\u2019ll show you how to build a hosting environment on Amazon AWS using the cPanel and WHM Amazon Machine Image (AMI)!<\/span><\/p>\n Before we dive into the actual process, be sure to read the\u00a0<\/span>Amazon\u00ae AWS ™ User Guide<\/span><\/a>.<\/span><\/p>\n Amazon\u2019s AWS platform exists behind a\u00a0<\/span>NAT infrastructure<\/span><\/a>. This infrastructure provides a robust hosting architecture that uses the following Amazon AWS features:<\/span><\/p>\n These features, combined with cPanel\/WHM\/DNSOnly, make deployment and provisioning of new servers unbelievably rapid and straightforward.<\/span><\/p>\n Ok! Since we\u2019ve finished with some housekeeping items, let\u2019s dive into the meat of the process. First things first, you\u2019ll need to sign-up for\u00a0<\/span>Amazon Web Services.<\/span><\/a>\u00a0The sign-up process is very straightforward, but you may have a wait a few minutes for the account creation to complete, allowing you to access all the services in the AWS Marketplace.<\/span><\/p>\n After successfully creating an account, let\u2019s start by navigating to the<\/span>\u00a0cPanel & WHM AMI\u00a0<\/span><\/a>in the AWS Marketplace.<\/span><\/p>\n Disclaimer #2<\/span><\/strong>: cPanel\u2019s support team only support the official cPanel & WHM AMI. Check to see that cPanel is listed as the creator.<\/span><\/p>\n <\/p>\n Once on the cPanel & WHM for Linux page, navigate to the top-right corner and click \u201cContinue to Subscribe.\u201d You will be taken to a \u201cSubscribe to this software\u201d page, which you review the Terms and Conditions. After this, you will simply \u201cContinue to Configuration,\u201d which again can be found at the top-right corner.<\/span><\/p>\n Upon arrival to the Configuration page, you will be presented with the Fulfillment Option, Software Version, and Region. For the Software Version, we recommend the most recent version of cPanel, and for Region, double-check that AWS automatically selected the correct region. If this is not correct, simply click Region and choose a new region.<\/span><\/p>\n Note:\u00a0<\/span><\/em><\/strong>Remember the region you selected for when we get to the \u201ccreate a key pair\u201d step.<\/span><\/em>\u00a0<\/span><\/em><\/strong>You must configure the key pair and instance to use the same region. If they do not use the same region, you cannot use the key pair with the instance. You also cannot edit the instance region after you launch the instance.<\/span><\/em><\/p>\n Next, select \u201cContinue to Launch\u201d in the top-right corner.<\/span><\/p>\n <\/p>\n The next interface you will arrive at is the \u201cLaunch this software\u201d page where most of the customization happens. Under the \u201cChoose Action\u201d section, you may continue with \u201cLaunch from Website,\u201d which is the default selection.<\/p>\n Under \u201cEC2 Instance Type\u201d, select the instance type that you wish to use. The list of instance types includes all of the types that the cPanel & WHM AMI support.<\/p>\n <\/p>\n Disclaimer # 3<\/span><\/strong>\u00a0Your EC2 instance type determines the rate at which AWS bills you. Make sure that you select an instance type that includes appropriate resources for the kind of system that you wish to run. If you host a large number of websites or multimedia content, you must choose an instance type that exceeds our minimum system requirements.<\/span><\/p>\n Continuing, we will configure the Virtual Private Cloud (VPC) settings. Under VPC. Settings, verify the Virtual Private Cloud (VPC) and subnet that the system selected. We deferred to the default option. If you would like to change one of these settings, click VPC. Settings and choose the desired VPC or subnet.<\/span><\/p>\n <\/p>\n Under the Security group, check the port and security settings. We recommend that you select \u201cCreate New Based on Seller Settings\u201d.\u00a0<\/span>We\u2019ve pre-configured this<\/span><\/strong>\u00a0to meet our system requirements and improve security for your system. So simply name your security group and provide a brief description and be on your way!<\/span><\/p>\n Note:<\/span><\/em><\/strong>\u00a0Only advanced users should select default.<\/span><\/em><\/p>\n <\/p>\n Next, you will need to select or create a key pair. Under Key Pair, verify whether the system selected is the desired key pair. To create a key pair, select \u201cCreate a key pair in EC2\u201d and then select \u201cCreate Key Pair\u201d to have a new one generated for you.\u00a0<\/span>Reminder: Ensure you are in the region you selected earlier to launch your software!<\/span><\/strong>\u00a0Next, refresh the section (not the page) using the circular arrows next to the drop-down menu and select the new key pair you just created.<\/span><\/p>\n <\/p>\n Finally, select the \u201cLaunch\u201d button on the bottom-left corner, and you will be taken to a notification page with the following confirmation information.<\/p>\n <\/p>\n Please keep in mind new instances may require several minutes to initialize. Until the initialization process finishes, the Status Checks column of the EC2 Management Console will display Initializing and an hourglass icon.<\/span><\/p>\n When you launch an instance, it is assigned a hostname that is a form of the private, internal IPv4 address.\u00a0<\/span>The hostname is set from the AWS Console, and if you don\u2019t set it correctly when the instance is first built, you cannot change it within cPanel\/WHM<\/span><\/strong>\u00a0Well you can, but it is a multistep process, so you are better off setting your hostname while the instance is initializing.<\/span><\/p>\n In case you forget, you can find how to change your hostname\u00a0<\/span>here.<\/span><\/a><\/p>\n Additionally, you will want to associate your instance with an elastic IP so you can be sure your IP address doesn\u2019t change in the future when stopping or restarting your instance. The documentation on AWS\u2019s elastic IPs is found\u00a0<\/span>here.<\/span><\/a><\/p>\n You can view your instances on the EC2 Console, which is hyperlinked on the notification page or view all your instances in \u201cYour Software.\u201d It will take you to a page that looks like this:<\/span><\/p>\n <\/p>\n Before you login to WHM for the first time, you will need to set the root password for the server since the AWS AMI does not automatically assign you one. To do this, log in via SSH as the centos user using the key you downloaded earlier from setting up key pairs. Establish an SSH connection to the server by using the following syntax: ssh root@IPaddress. Once you\u2019re in, run \u201csudo su -\u201d to become root, and then \u201cpasswd\u201d to set the password. You\u2019ll be asked to type the password twice.<\/span><\/p>\n Ok now grab your IP address so we can log in to WHM or cPanel for the first time. There are two ways to login, but the easiest way to get started is to use your server\u2019s IP address and port 2087 for WHM and port 2083 for cPanel. That login would look like this:\u00a0<\/span>https:\/\/127.0.0.1:2087<\/span><\/a>. Replace that 127.0.0.1 in the address with the IP of your server. Please note, you will need to accept the SSL warning the first time you log in. For more tips on logging in for the first time, please reference our knowledge base here:\u00a0<\/span>How to Log in to Your Server.\u00a0<\/span><\/a><\/p>\n And there you have it! An easy, flexible, and cost-effective way of hosting your websites. We\u2019d love to hear what you think about this blog post.\u00a0<\/span><\/p>\n Updated Aug, 19th 2020<\/strong> |\u00a0cPanel is excited to be added as a blueprint on Amazon Lightsail.\u00a0Getting started with cPanel on Lightsail has never been easier!\u00a0 Find out to\u00a0How to get started with cPanel on Amazon Lightsail!<\/a><\/p>\n\n
\n
Getting Started<\/h2>\n
Configuration Options<\/h2>\n
Customizing Your Instance<\/h1>\n
Launching Your Instance and Logging in for the First Time<\/h2>\n