www.digitaldaze.com
How do I allow server side includes from any directory?

"How do I allow server side includes from any directory on my Virtual Server?"

Instructions for virtual servers with a single config file (httpd.conf)

Apache provides many different ways to do this. We will describe one way here. Additional information can be found at the Apache website.

To enable SSI for the entire site (note that this will cause a small performance hit as apache will need to scan each file for SSI commands):

In your ~/www/conf/httpd.conf file:

Add Includes to the Options line for the htdocs and/or vhosts directories (htdocs usually is the main site and vhosts usually holds the virtual host sites)

Then look for the following section:

    # To use server-parsed HTML files
    #AddType text/html .shtml
    #AddHandler server-parsed .shtml

Remove the comment characters "#" from the beginning of the two "Add" lines. Save the file and apache will now parse all .shtml files for SSI commands.

If you want to use SSI in .html files, change the .shtml to .html in both lines.

Instructions for virtual servers using the older multiple config file format (i.e. httpd.conf, srm.conf and access.conf)

First, we recommend that you familiarize yourself with the configuration files for your web server which is based on NCSA httpd 1.5.1 software. An excellent on-line resource can be found at the following URL-

http://hoohoo.ncsa.uiuc.edu/

To allow CGI's to be executed from any directory do the following:

  1. Uncomment out the following "AddType" directive in the srm.conf file:
    AddType text/x-server-parsed-html .html

    You may want to add a Type for .htm files:
    AddType text/x-server-parsed-html .htm

  2. Add an Includes option to the Options for your Root Document declaration in the access.conf file:
    Options Indexes FollowSymLinks Includes

 

[Legal Notice]
http://www.digitaldaze.com