Configuring HTTPD Server on Docker Container and setting up the python interpreter on docker container.

Manojnagabairu
2 min readMar 29, 2021

In this article I want to explain how to configure httpd server on docker container .

Beside the normal way in docker container there are two changes with the normal linux operating systems.

They are:

  1. You don’t get “systemctl” command inside the docker container
  2. You have to enable patting for a specified port number while creating container for the httpd server

Here I will show how these changes are done….

Step 1:-

  • Pull the docker image from docker hub
  • Launch a container included with the patting of a port for the httpd web server , with the pulled image with the command →
  • “docker run -itd ‘image’:’version’ “ (here -d stands for detach)
  • And install httpd software with yum

Step 2:-

  • Add some data for testing into /var/www/html folder and save it

Step 3:-

  • Try to connect the container with the ip of the host operating system and with the given port number for the httpd server.

That’s all our web server is ready.

7.2

→ Nothing different from normal centos operating system

→ Just have to install python using yum and use it in container

🔹And write a python file and save it.

🔹And run it in the command line . You can see the output …

Thanks for reading the blog😊

--

--