Linux – How to run linux bash script from web browser

apache-2.2bashcgilinuxperl

Hi I have web server on it also. I had made simple bash script using vi editor..which will open file and then add some lines into it at last it will save automatically…and after that 2-3 linux command will be run as a specific user.

Now I want to do the same from web browser…so what I need to do for this?
html?perl?python?cgi?….?which is easy way to do the same?

Best Answer

You want to start with Apache 'suexec':

http://httpd.apache.org/docs/2.2/suexec.html

suexec support is compiled/ready in your default Apache install on a Red Hat/CentOS/Fedora - do a Google on "suexec howto" and you'll find a lot of articles for various tools (PHP, etc.) which will give you ideas.