How to Configure Apache for Javascript

By David Gitonga

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.

Configuring httpd.conf

Step 1

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 2

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 3

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

Step 4

Search for the string "AddHandler" and re-write it to read this way:AddHandler server-parsed .shtml

Step 5

Create a entry and enable the Includes feature as follows:Options Indexes Includes followSmyLinksAllowOverride AllOrder allow, denyAllow from all

Step 6

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

Step 7

Use the entry to allow for all web pages with a JavaScript include to be executed as follows: ServerAdmin webmaster@eHow.comDocumentRoot /var/www/eHow ServerName XBitHack On ErrorLog logs/eHow_log CustomLog logs/eHow_log common

Step 8

Save all the changes and refresh the page to test.