Apache Includes

Summary

Discusses how to use Apache includes and directives to create a lightning fast base technology wrapper from which you can build more complex applications.

Includes

Apache Server Side Includes has a checkered security past, resulting in it being rarely used by in environments where lending too much control over configurations to downstream users of a system is considered a bad idea. This is because it can necessitate an x-bit hack or setting (executable permissions) that is a usually a bad idea in Web-enabled folders. Definitely, if you are uncomfortable with managing permissions on your system, or cautious about allowing the x-bit setting, then you might not like the idea of using Apache includes when there are so many other adequate options to choose from.

On the other hand, if you're like me, and feel confident living with a bit of acceptable risk then the Apache includes can make you happy. Set variables, use flow control, make system calls or execute programs in other languages; as long as you know what you're doing you can enjoy all these benefits. My recommendation is to use a precise editor for the whole trip. In that case, for me, that would be Vim (and for you Emacs could be a similarly good choice). If you use another editor, you may be very limited by it in that we're talking about a lot of work done using a remote shell where Vim and Emacs reign.

Most people who use Apache SSI do so very lightly. You can pretty easily use them to return the time, or date last modified and all environment variables are available. The easiest way to use them is for common includes like doctype declarations, and user navigation, and footers. If you combine their ability to set variables with flow control, you can create conditionals that you can use as settings per page. That way, you can power unique titles, meta data and whatever else you can think would belong to an individual page. Very few use Apache includes this way, which means missing our on their speed.