Open In App

Configuring HTTPD server on Docker Container and setting up Python Interpreter

In this article, we are going to discuss a step-by-step guide on how to configure the apache web server on top of a docker container, and setting up a Python interpreter. Basically, we are installing the product of apache which is HTTPD on the docker container.

What is Docker?

In simple words, if I have to define docker, is a tool that can launch an operating system (install any operating system) in seconds. If you have noticed when we install any operating system it takes around one hour to launch, but docker giving you the facility the convenience to launch any os within seconds, and httpd is just a product of apache web service which we are using for creating webpages.



Prerequisites:

How to configure the HTTPD server on the Docker Container?

cd /etc/yum.repos.d/

toDocker repo

yum install docker-ce  --nobest
rpm -q docker-ce

Start docker service:

systemctl start docker

Check docker status:



systemctl status docker

Now to configure the webserver on the top of the docker container these are the steps:

Before launching the container in docker make sure to stop firewall and then restart docker.

Stop Firewalld

docker pull ubuntu:20.10
docker ps -a

Lunch docker container

docker start taskd

Going inside the docker container 

apt-get update

Installing webserver(Apache) on the container

apt-get install systemctl

Installing systemctl command in container

Installing net-tools 

Running ifconfig to see IP

apt-get install vim

Install vim to create a file

Creating a website

Starting the web service

See the website in the firefox

Setting up the Python Interpreter in the Docker Container 

python3 -V

Article Tags :