Hello, everyone. I am Shashikant Dwivedi, and I will demonstrate how you can set up Apache Server in this article.

Apache is used to create an HTTP server to host our web applications.

So before heading toward the procedure, you must have some prerequisites. The prerequisite is -

If you don’t have a Linux server, you can create one from AWS. Follow this article to create a Linux server.

Let’s move on to the next steps if you have all the prerequisites.

Steps

  1. Firstly, connect to your Ubuntu server. To do this, open the Instances tab on your EC2 dashboard in the AWS account and copy the IPv4 public IP. Then open your terminal and type this command
ssh -i private-key.pem ubuntu@your-public-ip
  1. Now update and upgrade your Linux server by using commands
sudo apt-get update
sudo apt-get upgrade
  1. Now install the Apache server using this command
sudo apt-get install apache2
  1. Now check if the firewall is enabled or not. If enabled, then enable it by command
sudo ufw status

If this shows status: inactive.Then allow it by command

sudo ufw enable
  1. Now enable Apache and ssh in UFW by commands
sudo ufw allow 'Apache Full'
sudo ufw allow '22'
  1. Now that everything is configured on the server, it's time to make changes to the EC2 dashboard.
  2. Open security groups from the EC2 instance tab.
  1. Now open the Inbound tab and press the edit button.
  1. Now just add HTTP rule and make it available from everywhere and save this configuration.
  1. Now just copy your server public IP and paste it into the browser.

So just by following these 10 steps, you can easily set up an apache server.
I hope you liked the article. If you have any problems, you can ask me in the comment section.

Share this post