How to Configure Apache for Javascript

JavaScript is used to create dynamic web pages that include pop up menus and animations on HTML pages. If the web pages are to be run on an Apache web server, then the Apache server needs to be configured for Server Side Includes (SSI). This functionality allow servlets or small server side code snippets to communicate with the browser programs called applets and can even be used to generate complete web pages. In Apache this functionality is enabled by editing the “httpd.conf” file.

...
Apache Web Server configurations

Configuring httpd.conf

Step

Fire up your Apache web server. Since the Apache web server comes as a bundle of other third-party server software in most cases, all you will need to do is fire up the bundled application to activate the Apache server inside.

Step

Locate the server icon on the taskbar if you are using a local-based server. This icon will show all the services running. Click once to bring the menu and locate the Apache folder.

Step

Locate the server configuration folder if you are using a remote server. Locate the PHP folder which will contain the “httpd.conf” file.

Step

Search for the string “AddHandler” and re-write it to read this way:

Step

AddHandler server-parsed .shtml

Step

Create a entry and enable the Includes feature as follows:

Step

Step

Options Indexes Includes followSmyLinks AllowOverride All Order allow, deny Allow from all

Step

Step

Ensure that all your files containing some JavaScript or a server-side include have an .shtml extension.

Step

Use the entry to allow for all web pages with a JavaScript include to be executed as follows:

Step

DocumentRoot /var/www/eHow ServerName www.eHow.com XBitHack On ErrorLog logs/eHow_log CustomLog logs/eHow_log common

Step

Step

Save all the changes and refresh the page to test.