How to Host a Dynamic Website on AWS

This article has been written by Digital Marketing & Web Design Expert Kasra Dashtipour

Struggling to find the right platform to host your website on? Amazon, believe it or not, specialises in web hosting as well as online shopping and entertainment. But why should you use their services, and how can you get started?
 
The major benefit of using AWS lies in the fact that it is flexible. Its EC2 service gives you full access to a broad and versatile server. So, the things you can do with AWS will likely outstrip other basic hosting solutions.

Hosting Methods

To host on AWS, you can follow one of two methods:

  • Use EC2, and build your application from scratch;
  • Or use an elastic beanstalk – which will let you launch an application using a separate console.

While many people choose to use an elastic beanstalk backend, direct EC2 uploading offers stacks of flexibility. In this guide, we’ll be looking at direct application control only.

How to Host a Dynamic Site on EC2

  1. Let’s take you through the basic steps of getting a dynamic site up and running on EC2 via Amazon AWS.
  2. Make sure to launch an instance, to begin with. This is simple to do through the AWS backend.
  3. Connect to the instance you have created by using putty. This is a separate plugin you’ll need to download, but it shouldn’t add too much time or hassle to the process.
  4. From here, make sure to update the server with the command ‘sudo apt-get update’.
  5. Then, install your web server using the command ‘sudo apt-get install lamp-server^’. This will ensure that you have access to coding languages and an apache server.
  6. Locate your instance’s public DNS. Copy it, and paste it into a browser address bar, before hitting ‘go’.
  7. If you’re given a message stating ‘it works’, then – enough – the server works!
  8. From here, you are going to want to start uploading web pages. You’ll find the folder for web pages via the command ‘cd /var/ www’.
  9. Make sure you use a web page uploader program such as Filezilla to upload the content you desire. You should focus on uploading CSS, HTML and PHP files into this folder, but be sure to erase the existing index.html in there first. You’ll be able to find your own index.html by visiting your own DNS.

How to Host a Static Site

Prefer to host a static website instead? You’ll need to make use of Amazon’s S3 dashboard. You’ll only be able to host dynamic sites on EC2, so make sure you know which type of site you’d prefer to manage.

  1. As with EC2, make sure to design and save any web pages you’d like to go live on your local device. You’ll need to upload them to S3 shortly.
  2. S3 is managed through the use of buckets. To start with, you’re going to need to log into Amazon AWS through the S3 dashboard.
  3. Once logged in, make sure to create your first bucket, and to create a website address or name.
  4. Click ‘upload’ or ‘add files’ to begin adding your pages to the bucket. choose from an uploader screen which will pop up.
  5. Click ‘make it public’ once you’re happy with what you’ve uploaded.
  6. You can set up a custom S3 address for your website – which you may wish to do, as some bucket addresses can be a little lengthy!

Whether you prefer dynamic or static hosting, Amazon offers a refreshing, user-friendly interface which you can easily get started with. Take a look!