In this post, we are going to see how to create a web server in Amazon Web Services (AWS) using an Elastic Compute Cloud (EC2) instance that consists of a Linux virtual machine with which we can do whatever we want. Most importantly, Amazon gives you one year free to use it; after the year, it will charge you for hours of use and storage, but the instance can be stopped and terminated whenever you want.
Amazon Web Services (abbreviated AWS) is a collection of cloud computing services offered over the internet by Amazon.com, and it is used by many major companies in the world such as Dropbox, Foursquare, Expedia, Airbnb, Netflix, etc. It is also used by thousands of technology entrepreneurs who take advantage of its flexible cost scheme to launch their solutions.
As solution developers and technology entrepreneurs, some of AWS ‘most exciting services are:
- EC2, Virtual Cloud Servers
- S3, Scalable Cloud Storage
- CloudFront, Global Content Distribution Network
- RDS, DynamoDB, Cloud Databases
- Lambda, Code execution in response to events
You can use all these services or some only according to your needs. In this post, you will see how to use EC2 to launch an instance of a Linux server and inside it, install a web server.
First steps
First of all, it is necessary theprior registration to the service, which is very simple since you only need to have a credit card or debit card (while use free services no, you will be charged anything on the card) and confirm your account by email.
In its extensive range of services, we have selected one of its scalable services which are the Amazon Elastic Compute Cloud (Amazon EC2), which allows us to have a VPS virtual server for free as long as it does not exceed 750h of use per month, more than enough hours.
How to configure a server in Amazon Web Service
1. AWS Login
The first thing that appears when we log in to AWS is the main dashboard.
2. Choose service
To start creating a web server (instance) on AWS, we will go to the Services tab and select EC2.
3. Service location
Before continuing, make sure you have the location-of the data centering the area that you think is convenient. For example, we can choose US-EAST-1. Then you have to click on the “Launch Instance” button.
4. Choose SO
To follow the wizard, you must select the server operating system, in this case, Ubuntu 18.04, one of the free ones.
5. Choose instance type
The hardwareis the next step to choose from but keep the default.
6. Instance configuration
We leave the default values in case you do not need other features and continue enjoying the AWS free layer.
7. Configure storage
In this case, we can create a container of about 30 GB without a problem.
8. Add Tag
Very useful to carry an organization of the machines that we are deploying, it is nothing more than a name associated with the instance.
9. Configure security group
In this group, we will define the rules of our firewall, by default, it is added the one to allow all the traffic of the SSH service. The ports will remain blocked until the exception is added to the security group of our web server in Amazon.
10. Preview and launch
To preview the final data and the characteristics of the instance, click on “Review and Launch.”
Now all you have to do is click on the “Launch” button to start installing the instance.
11. SSH keys
Before continuing, we will carry out this step, in which we indicate that we want to create a new pair of SSH keys with which we will later log in to the instance.
- After a couple of minutes, we will have the instance finished and operational.
- To connect to the server, you will have to select the instance and click “Connect.”
Connect to the Linux instance
You can connect to the Linux instance using Putty, which offers an effortless and easy way for the connection. You need to download and install Putty software and fill up with the IP address and port to connect to the desire instance.
You can connect to the Linux instance without Putty too; however, we recommend you to use Putty initially as it offers an effortless way to connect to the server.
Install webserver on Amazon (Apache)
Just log in to the server and run the following command:
apt-get install apache2
Install webserver on Amazon (Nginx)
Just log in to the server and run the following command:
apt-get install nginx
With these last steps we would already have configured a web server in amazon web services.
Leave a Reply