3 Ways To Selectively Execute HTML Files Using Apache HTTP Server
By Angsuman Chakraborty, Gaea News NetworkSunday, January 14, 2007
A very simple way to execute HTML files is by telling the server to parse html files for SSI commands. To do it simply add the following lines to your .htaccess file:
AddType text/html .html
AddHandler server-parsed .html
This has the downside of processing all the html files in that directory and its subdirectories. A better way is to mark the files you want to execute with execute bit set and then add the line to your .htaccess file:
XBitHack on
XBitHack tells Apache to parse files for SSI directives if they have the execute bit set. So, to add SSI directives to an existing page, rather than having to change the file name, you would just need to make the file executable using chmod.
chmod +x pagename.html
There is a third and even simpler way to execute programs and display the results using AJAX. You can use any popular AJAX framework like Sajax or Prototype to make calls to the server and then display the results dynamically. This had the added advantage of being able to repeatedly update page contents.
Note: Flash and Java applets are two other alternatives. However they are less used these days.
ANTU JAIN