Configuring Apache Web Server And Python Interpreter on Docker Container.

Rohit Raut
3 min readNov 30, 2020

Prerequisites:

Docker Must be installed

Task Description:

🔅Configuring HTTPD Server on Docker Container

🔅Setting up Python Interpreter and running Python Code on Docker Container

Step-1: Pull Container Images

To launch any Operating System we need an image and to download the image run the docker command.

syntax: docker pull image:version 
Pull an image from the docker registry

To see all images run the command.

docker image ls
Docker Images

Step-2: Launch Container

To launch the container run the following command. here -i is for interactive and -t is for a terminal. This will give directly terminal.

Step-3: Install Apache Webserver

To install Apache Webserver run the command.

yum install httpd -y

Step-4: Start service

To start service in centos and RHEL latest version we use systemctl command but in the container image, this command is not available. So we have to use a file which internally loaded by systemctl to start the HTTP server.

for this:

Step-5: Upload Pages In /var/www/html

Step-6: Install The net-tools software.

It provides the ifconfig command to see the IP address.

yum install net-tools

Step-7: Access webpage.

Setting up Python Interpreter and running Python Code on Docker Container

Step-1: Install Python3

Running Code.

Thank you for reading :)

--

--