0% found this document useful (0 votes)
96 views4 pages

Install Apache2 on Docker EC2 Ubuntu

The document provides steps to install Apache2 on an EC2 Ubuntu instance using Docker. It involves pulling the Ubuntu Apache2 image, running it in a container exposing port 80, and opening port 80 in the EC2 security group. Finally, the user navigates to the public IP in a browser to see the Apache2 index page, and verifies installation by stopping the container.

Uploaded by

Saurabh Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views4 pages

Install Apache2 on Docker EC2 Ubuntu

The document provides steps to install Apache2 on an EC2 Ubuntu instance using Docker. It involves pulling the Ubuntu Apache2 image, running it in a container exposing port 80, and opening port 80 in the EC2 security group. Finally, the user navigates to the public IP in a browser to see the Apache2 index page, and verifies installation by stopping the container.

Uploaded by

Saurabh Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Assignment to install apache2 using docker

Step-1: Start ec2 ubuntu instance

# sudo apt-get update


Step- 2: Install docker engine using command

# sudo apt-get install docker.io -y

# docker –version

Step- 3: Give permission to user for docker

# sudo usermod -a -G docker $USER

# sudo reboot

After reboot reconnect with instance

Step- 4: Pull apache2 image

# docker pull ubuntu/apache2


Step- 5: run apache2 image

#docker run -d --name my_apache -p 80:80 ubuntu/apache2:latest

Step- 6: Open port 80 in EC2 Security group

Step- 7:

Copy EC2 instance public ip and paste it in browser

Final output of apache2 index page

Step- 8:

Checking by stopping container

You might also like