AWS EC2 CentOS Server Apache

Lesekr
4 min readJun 5, 2023

Let's launch an AWS EC2 CentOS server on Apache.

First, let's take a look at the definition of Apache. Apache is a software server that runs on an HTTP server. It’s a connection between a server and a web browser like Google Chrome, Firefox, Safari, et cetera.

As the French would say, “Et commençons!". Meaning, let’s start!

Remember how we first started the first project by launching an EC2 instance? We will be starting that way again. Log into your root user account and enter your password. Once on the home page, you will be here (see image below).

  1. Now you are on your home console with your most recent visit page(s).

Click on EC2.

And click on Launch instances.

2. Create a name

3. We will be searching for a CentOS server here.

4. Once you have typed CentOS Server, go under Marketplace AMIs to get a more in-depth search.

5. As a result,

Select CentOS 7

Click, select. CentOS 7 is added to your start-up instance. Scroll down to Key Pair.

Select create a new key pair. Once you have created the new key pair, select create.

6. Now scroll down to the Network Settings to Edit (‘to the right, to the right’).

  • You need to set up TWO (deux) security groups. Rule 1 (une) and Rule 2 (deux)

Most importantly, the ‘Summary’ section, just to double check our work. Once verified, let's launch!

et Voila!! A green success bar will appear on top.

7. Let’s connect!

Click on the SSH client. Use the example section to copy and paste it into the terminal.

8. Let's bring up the terminal. Paste the SSH, but also change Ec2-user to centos on the terminal. If not, you will be doubting yourself as to what went wrong.

Now let’s run this command once you have successfully entered centos.

sudo yum update -y

Once it’s done with the update,

sudo yum install -y httpd

once completed.

sudo systemctl start httpd

next step.

sudo systemctl enable httpd

9. Let's see if it works on the web! copy your public IP from your EC2 Instance

Open a new tap and paste your public IP.

Et voila!! Success!!

Now, go ahead and relax.

Until next time.

--

--