Configuring HTTPD Web Server on Docker Container.

Zoro
3 min readNov 5, 2020

Inorder to configure Httpd software on a docker container, first we have to configure docker on our Base O.S. Let’s see how we can configure docker on our Base O.S, in my case ie. Redhat Version 8.

1. Steps to configure and launch a container on docker :

~ Docker Configuration..

• Installing docker is pretty simple, just by running one command we can very easily install docker on our Base O.S .

Cmd : yum install docker

~ Starting Docker Services..

• Commands to start docker services.

- systemctl start docker

- systemctl enable docker

~ Launching a docker container..

To launch a docker container we need a docker image of the O.S that we want to launch. In my case am launching CentOS.

Cmd : docker pull centos

• Commands to launch a docker container

- docker run -it --name (container name) centos

- docker start (container name)

- docker attach (container name)

The docker container is successfully launched.

2. Httpd service configuration.

* Note : In order to configure Httpd software, first we have to stop the firewall of our base O.S

~ Run this command on your base O.S

- systemctl stop firewalld

-systemctl disable firewalld

- restart docker services

~ Command to configure and start httpd services.

Cmd : yum install httpd

• Here Docker Container doesn’t support systemctl command, therefore we have to start the services by running the file that runs behind the systemctl command to start services. The file name is :

/usr/sbin/httpd

• After we start the services, go to the document root and create a file with (file name).html extension and write your html code to design your webpage.

Webpage Launched on a Docker Container

To know more about webserver configuration and web hosting from AWS with Cloud Front integration. 👇

Blog link : “CREATING HIGH AVAILABILITY ARCHITECTURE WITH AWS CLI.” by Sourav Pattnaik https://medium.com/@sourav.rishi1234/creating-high-availability-architecture-with-aws-cli-d5547c556abb

* Thanks to my amazing team mates :

~ Ashutosh Kodgire

~ Akshit Dharmendrakumar Modi

~ Janhavi Jain

~ Gursimar Singh

* A special thanks to Vimal Sir. You are an inspiration ! ✨

--

--