Configuring Httpd Server and Setting Up Python Interpreter on Docker Container

🔰 TASK DESCRIPTION:

🔷 Configuring HTTPD Server on .

🔷 Setting up Python Interpreter and running Python Code on Docker Container.

✍What is Docker ?

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.

✍What is Docker Container ?

Docker is a tool by which we manage the container , container is like a operating system you can launch these container with in a second ,docker work on the top of these container’s.

Let’s Start Practical Part -

Step-1) Installation of Docker -

  • First configure docker repository whenever download docker software on base OS. For that we have first go to /etc/yum.repos.d/ after that create a repo file for docker software -
cd /etc/yum.repos.d/
vi docker.repo
  • To Install Docker Software in RHEL8 use following command -
yum install docker-ce --nobest -y
  • Now Start the Docker Services -
systemctl start docker
systemctl status docker

Step-2) To launch a new container or OS in Docker, we need Docker image.

  • Now pull a Docker Image from Docker Hub.
docker pull 'image_name:version'
  • Check the available images in docker
docker images

Step-3) Now Run a Docker Container using following command -

docker run -it --name 'name_of_container' 'image_name:image_version'
  • Now check that the container is running or not
docker ps -a

Step-4) we want httpd software for configuring apache web-server . For downloading httpd software we need yum command . First we check yum is configure or not -

yum install httpd 

Step-5) Now create a web page inside the container. For that go inside ‘/var/www/html/ ‘ folder then create a web page.

Configuration of Web server

  • To Launch the httpd server run following command -
  • Now Start the httpd service but systemctl command doesn’t support in docker container. So we will use /usr/sbin/httpd to start httpd-
cd /var/www/html/
vi profile.html
/usr/sbin/httpd
curl 'ip_of_container/page_name'

Here we can see that web page is running Successfully !!

Step-6) Configuring Python Interpreter -

  • First, we have to install the python3 inside the Docker Container. Use following command to install python3
yum install python3
  • Now check python3 is installed or not. For this Check the version of python using following command-
python3 -V
  • Now use Python3 REPL Interpreter to execute python code.

In this way Task is Completed Successfully !!

!! Thank You for Reading the Article !!

--

--

--

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

Recommended from Medium

Error Found When Loading /home/user/.profile

I am a Ruby on Rails developer and am also a Certified AWS Solutions Architect (Associate), working…

Using off-heap memory in Java programs

Limitations with current database operators in Kubernetes: StatefulSet (Part 3)

How to enable collider's in Blender for The Decentraland Builder

Developers and engineers — what’s in a name?

Diary of a wimpy DevOps engineer: Monoliths

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
Mangesh Ghorpade

Mangesh Ghorpade

More from Medium

What is Django

Integrating Flower with Celery in Django Project Using Docker

Bitwise Operators

CodeSignal Arcade The Core (17/162) Kill K-th Bit