You can run cgi-bin Bash scripts pretty much out of the box after you've installed apache2:
sudo apt-get install apache2
Your default index.html is located here:
Put your hello.cgi bash scripts in: /usr/lib/cgi-bin:
sudo vi hello.cgi
echo "Content-type: text/html"
echo "<HTML><HEAD></HEAD><BODY><h1>Hello World</h1></BODY></HTML>"