Creating A WebApp to Run Linux commands and display the output of the command will display within the webpage
Hello techies !!!
After a long time i am back with more interesting article. In this article i created a user friendly webapp where we can run almost linux commands in the web and output will display within the webpage done with the help of javascript where intermediate act with the backend app and frontend app
To do entire thing we have to setup the webserver in your system for that i am setuping the apache httpd webserver in my redhat system.
Installing the httpd webserver in Redhat
yum install httpd
Starting and Enabling the services of the httpd
Starting the service of the httpd#systemctl start httpdEnabling the service of the httpd permanently#systemctl enable httpdChecking the status of the httpd#systemctl status httpd
Acessing the default Redhat test webpage with the Ip adrress
You can see in the linux.html file included the external files of the javascript and css placed a input box and button in the html page.
whenever after typing the command in the input box and clicked the button then lw() function will be called.
After clicking the button lw() will be called and commad entered data is stored in the id of input we retrived the input command by using getElementById function of DOM and opening the backend webpage of the python and output of the backend program will stored in the responseText and that output will be replaced with the div d1 in the html page
Backend Python file
Giving sudo permission to the apache webserver
Stoping the selinux security to access the another program by apache httpd
Acessing the webpage from the browser
Running date command
Running cal command
Thanks For Reading !!!!!