How to run linux bash script from web browser?

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.


Add the following options in your apache config under your Directory (or Virtual hosts been a while so not sure on the virtual hosts bit) section.

Options ExecCGI Includes
AddHandler cgi-script .cgi

then rename your shell script to something .cgi and then make sure that the file has the correct permissions/ownership