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.
Now we need to install httpd. We will be using yum command to do so.
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 .
Here we have created a file named arth.html, which has the following contents.
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.
Thats it!!
The webserver set up on docker container completed.