Steps for configuring Apache HTTP WebServer and Python on the top of Docker Container

I am using RHEL-8(Redhat Enterprise Linux) as my Base OS.

Steps 1:- Add the URL of the repository for downloading.

Step 2:-Start docker service and pull image from the repository and execute it.

Before executing docker run -i -t --name webserver1 centos:latest we can see that we are in baseOS and afterwards in container. This command is use to launch a container.

Step 3:- Install apache webserver and create a WebPage

After successful installation, it’s time to create a webpage. Create a webpage either using gedit or vi editor. Here I am using vi. We need to create your page inside /var/www/html/ folder . It is a by-default folder , we can change it too. But for now I am using the given one.

The data written in this file will be displayed on the webpage.

Step 4:- Start the httpd service and check the webpage

For checking we can use curl command , so we need to know the ip address of this OS. We can’t use ifconfig command directly, for this first we need to install net-tool using yum install net-tools .

Now check the ip address using ifconfig command.

You can curl from the same OS or either use base OS for checking the webpage. Use command curl <ip-address> .

Successfully Executed! You can we the actual page from web browser.

Step 5:- Installation of Python on Container OS

Check whether it is installed

That is it! We have successfully configured Apache Webserver and Python on the Container OS.

Thank You Reading !!! I hope you find it helpful.