Enabling mod include

From Web Developer Network Wiki
Jump to: navigation, search

The Apache module mod_include is needed to use the .shtml UNL Templates on Apache webservers.

The mod_include module is normally included in Apache installations and just needs to be turned on to enable .shtml file parsing.

Open the httpd.conf file. Search for '.shtml' and uncomment these two lines:

# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
  • Note Apache 1.3 has a somewhat different syntax. The two lines are similar:
AddType text/html .shtml
AddHandler server-parsed .shtml

Find the <Directory...> section that references the root of your webserver:

Linux, similar to: <Directory "/var/www/htdocs">

Windows, similar to: <Directory "C:/Program Files/Apache Group/Apache2/htdocs">

Inside this section there is a Options directive. Add 'Includes' to the Options directive for the root of your server.

Options Indexes FollowSymLinks Includes

Additionally, you may want to alter the document index to include index.shtml: Search for DirectoryIndex and add index.shtml to the list:

DirectoryIndex index.html index.html.var index.shtml

Restart the Apache Webserver: On unix/linux or mac os x servers 'sudo apachectl graceful' Windows, you can use the Apache service monitor or restart the service through the Services section of the Administrative Tools.

Includes should now be turned on.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox