|
|
|
![]() |
Configure for server-side includes To enable it, you first need to make sure it has been compiled into your version of Apache. Go to the directory where your httpd executable resides, typically /usr/local/apache/sbin, and type ./httpd -l.
That should return a list of all the modules included in your build of Apache. Hopefully mod_include.c is in that list. If not, you'll have to rerun the Once you've
determined that mod_include is available, you have to allow the execution of includes and map an appropriate filetype. As with all things Apache, there are about a gazillion ways to do this. Probably the easiest is to enable all
the options in one place in your access.conf file: All files in the /usr/local/apache/share/htdocs/include
directory that contain a .shtml extension get parsed by Apache before being sent out to a browser. In many instances, the
To test your settings, create a test.shtml file like this one: Apache will attempt to parse any text that starts with a <!--#. The example uses three SSI commands--flastmod, printenv, and exec (the complete list of SSI commands is on the Apache Quick Reference Card). The flastmod prints the last-modified date for the specified file, printenv spits back a list of environment variables and their values, and exec runs the specified shell command. Note that if you've configured Options +IncludesNOEXEC , then the exec command returns an error message instead of the current date and time.
|
|