Configuring Web server n Python interpreter on Docker

Before configuring the httpd web server and python interpreter we first have to instal Docker in the system.

First by going inside the /etc/yum.repos.d/ lets create a repo.

Now, let’s the the following things in repo file…

Docker is now succesfully installed in your system. Now let’s start the docker service

Let’s now pull the docker image to configure webserver on it.

Now launching, run and booting the OS in 1 sec using docker:

Installing httpd software for webserver:

Now, moving to /var/www/html folder and creating a html file.

In docker as systemctl cmd doesn’t work, we use /usr/sbin/httpd to start the httpd services

Now installing python3 using yum:

Now, moving to /var/www/cgi-bin folder to create the python API file. We can simply create the file locally in any folder and run it. We can view the file in browser by making the file executable, but here I’m just running locally to check if python interpreter is working on docker:

Thank you!!




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to optimize Sieve of Eratosthenes in C


How to create liquidity pools/farms on Atrix.

How to Generate and Decode QR Codes in Python

How To Install Jenkins on Ubuntu 16.04 LTS

Simple CRUD Application by using Python Flask with SQLAlchemy

HandyMiner GUI and CLI Updates

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Krithika Sharma

Krithika Sharma

More from Medium

A Simple Tip Calculator Application with Tkinter (Python GUI)

Python and REST APIs

Docker Python Hello World

PYTHON for System Programming — Part 1