Docker Webapp

Ishita Mittal
2 min readSep 1, 2021

First, we should open the Rhel 8 terminal and stop the firewall security. Using these
#systemctl stop setenforce 0
#systemctl disable firewalld
make sure first you have to install the httpd server using this command. if you already install then don’t run this command.
#yum install httpd
and start the apache server, using this command.
#systemctl start httpd
then, go to the directory cgi-bin and create the python file. and make an executable file.
#cd /var/www/cgi-bin/
#vim dockrer.py
#chmod +x docker.py

In this program, we have to import the libraries’ cgi and subprocess. The CGI library makes possible communication between clients and web servers. Whenever the client browser sends a request to the webserver, the CGI program sends the output back to the web server based on the input provided by the client-server. the content-type line is sent back to the browser and it specifies the content type to be displayed on the browser screen.
and after that, we will go to another directory “/var/www/html” and create an HTML file

In this program, we will create a responsive web page. we have created a function to the request to the HTTP server and server send back to the response and show the output to the web page.
and after that go to the browser and type your IP and your HTML file name.
for example- ip-address/docker.html

Now you can run docker commands in browser

--

--