Configuring HTTPD Server on Docker Container

Configuring HTTPD Server on Docker Container

In this task we need to setup out apache web server on the top of a docker container.

So we know there are basically 3 steps for configuring any web server.

step 1:

Installing the software for webserver. Here we are using apache webserver , so we need to install httpd.

Here we have created a docker container named httpd.doc and we will be launching our web server out here.

No alt text provided for this image

Now we need to install httpd. We will be using yum command to do so.

No alt text provided for this image
No alt text provided for this image

First step is completed !

Step 2:

In this step we will be configuring the httpd file. For this we have to create a file in the directory /var/www/html .

No alt text provided for this image
No alt text provided for this image

Here we have created a file named arth.html, which has the following contents.

No alt text provided for this image

Step 2 completed.

Step 3:

Now finally the only thing we need to do is start the services. But we cannot use the systemctl command in docker initially because it is not enabled. So in order to start to services we have to we have to start the process that is generally started by systemctl.

It is /usr/sbin/httpd.

No alt text provided for this image

Thats it!!

The webserver set up on docker container completed.

No alt text provided for this image






To view or add a comment, sign in

More articles by Manish Priyadarshan

Explore content categories