Linux

How to install and configure apache on your Linux server

Hello, everyone, I am Shashikant Dwivedi and in this article, I’m going to demonstrate, how you can set up apache on your Linux server.

Apache is used to create an HTTP server, in which we host our web applications.

To proceed further, you must have an linux server. I am using Ubuntu server which is hosted in AWS.

Steps

#1

Firstly connect to your ubuntu server. For this open Instances tab on your EC2 dashboard in aws account and copy the IPv4 public IP. Then open your terminal and types this command.

ssh -i private-key.pem ubuntu@your-public-ip

#2

Now update and upgrade your Linux server by using commands

sudo apt-get update
sudo apt-get upgrade

#3

Now install the Apache server using this command

sudo apt-get install apache2

#4

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

#5

Now enable apache and ssh in ufw by commands

sudo ufw allow 'Apache Full'
sudo ufw allow '22'

#6

Now from the server, all things are configured now its time to do some changes from EC2 dashboard in aws dashboard.

#7

Open security groups from the EC2 instance tab.

#8

Now open Inbound tab and press the edit button.

#9

Now just add HTTP rule and make it available from everywhere and save this configuration.

#10

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.
Hope you have liked the article. And if you have any problem, you can ask me in the comment section.

Shares:

Leave a Reply

Your email address will not be published. Required fields are marked *