Table of Contents
![](https://www.coddicted.com/wp-content/uploads/2023/05/image.png)
Step 1. Sign in to AWS Management Console
Step 2. Launch an EC2 Instance with desired specifications
![](https://www.coddicted.com/wp-content/uploads/2023/05/image-3-1024x480.png)
![](https://www.coddicted.com/wp-content/uploads/2023/05/image-6.png)
![](https://www.coddicted.com/wp-content/uploads/2023/05/image-5.png)
![](https://www.coddicted.com/wp-content/uploads/2023/05/image-1.png)
![](https://www.coddicted.com/wp-content/uploads/2023/05/image-4.png)
![](https://www.coddicted.com/wp-content/uploads/2023/05/image-2.png)
Click > Launch Instance
![](https://www.coddicted.com/wp-content/uploads/2023/05/image-7-1024x149.png)
Step 3. Connect to an EC2 instance
Select EC2 Instance Connect option and click on Connect button
![](https://www.coddicted.com/wp-content/uploads/2023/05/image-8-1024x726.png)
![](https://www.coddicted.com/wp-content/uploads/2023/05/image-9.png)
Step 4. Install an Apache Server on the instance
a. Switch to root user:
1 |
sudo su |
b. Now run the updates using the following command:
1 |
yum -y update |
c. Once completed, let’s install and run an Apache server
Install the Apache web server:
1 |
yum install httpd -y |
d. Start the web server:
1 |
systemctl start httpd |
e. Now Enable httpd:
1 |
systemctl enable httpd |
f. Check the webserver status
1 |
systemctl status httpd |
Step 5. Create a web page and publish it on the instance
a. To add the contents into index.html file using echo, copy and paste the below command to shell.echo”
1 |
<html>Hello World!</html>">/var/www/html/index.html |
b. Restart the web server by using the following command:
1 |
systemctl restart httpd |