APACHE TIPS


  • In order to Include HTML Files within HTML Files, first enable SSI directives in the httpd.conf file by adding +Includes to the directory Options directive.

    Options +Include


    If you would like to have all .html files parsed for SSI, you need to add this to the filtering directive

    AddOutputFilter INCLUDES .shtml .html


    then add the line

    XBitHack on


    in your httpd.conf file. Then restart Apache. In your .html file, place the line

    <!--#include FILE="navbar.html" -->

    or whatever filename you would like in place of "navbar.html"

  • In order to change the default behavior of the directory listing/auto indexing done by apache, changes need to be made to the Apache Module mod_autoindex in your http.conf file. In particular, we can change the header of a file so that it includes a separate html file.

    This is accomplished by adding (in the mod_autoindex.c directives of the httpd.conf file):

    HeaderName /DirectoryIndex.html

    where / is with respect to the root directory of the apache installation (for default MAC OS X set-up this is /Library/Webserver/Documents/) and DirectoryIndex.html is the name of the .html file from which the source is taken. Then restart the apache server.


  • The default behavior of the directory listing is to use FancyIndexing. This is nice since it allows a user to sort through the directory by the file's name, size, or last modification date. However, the default is to include a column called "Description" with a large width of 49 bytes (characters). The large width of this column results in the file name being chopped short.

    To disable this behavior, we can add the following line (in the mod_autoindex.c directives of the httpd.conf file):

    IndexOptions FancyIndexing NameWidth=* SuppressDescription

    Then restart the apache server. On Windows, you must first uncomment the line

    Include conf/extra/httpd-autoindex.conf

    in httpd.conf and then add the IndexOptions statement above to conf/extra/httpd-autoindex.conf