Setting up WebServer on Docker and python interpreter

Shubham kumar
Nov 13, 2020

--

For how to install docker and use refer to my previous story: click here

AGENDA:-
đź”…Configuring HTTPD Server on Docker Container
đź”…Setting up Python Interpreter and running Python Code on Docker Container

1.First Configuring HTTPD server:-

  • >> $ yum install httpd # installs httpd apache webserver
  • >>$ /usr/sbin/httpd # to start http services(systemctl doesn’t support here)

To confirm that httpd services has started use:-

  • >>$ netstat -tnlp # check whether port 80 is working or not

Now we need ip for checking our webpage which is situated on path /var/www/html : put your html file here only
So, for getting ifconfig command ,

  • >>$ yum whatprovide ifconfig # check which package provides this command
  • >>$ yum install net-tools #by above we get that net-tools is the package

Now, get ip using ifconfig command and using browser check whether your webserver is working or not(http://172.17.0.1/f1.html)

2.Setting up Python Interpreter and running Python Code :-

  • >> $ yum install python3 # to install python 3

Now python is install ,write some python code and run for demo:-

  • >> $ vi demo.py # makes py file /write code in this file
  • >>$ python3 demo.py

--

--

No responses yet