Posts tagged side

Apache2 Server Side Includes

Server side includes allow for external html documents to be injected into a page prior to it rendering on the client web browser. The benifit of this is eliminating the need to repetitiously repeat code over and over again. If you include the same scripts, on each of your website pages, you can create an external html document and inject it using a server side include with a single line of code. If your using virtual host containers, you can include the server parameters directly in the file. Add the following directory block and make the directory path that of the virtual host block’s document root:

<Directory /var/www/*>
Options +Includes
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</Directory>

Make .shtml the extension of the files you are including. I think you can make it anything, I just used “.html”.

Then enable the module:

sudo a2enmod include

Reload apache2:

sudo /etc/init.d/apache2 restart

Then include external html files using:

<!-- #include virtual="/mrtg/file1.html" -->

Your Server – The Boot Process

You want to isolate all your server features into background process. You don’t want any server features to be dependent on graphical or client side applications. I previously had my mail server dependent on the client side filtering capabilities of Thunderbird. This was a no no because it required me to maintain a desktop session. This was not optimal because during the day the desktop session was swapped to the hard drive and this caused substantial system lag when coming back to use the desktop. Now with VBoxTool, the web server is automatically booted with the host system, and all functions on the server are consolidated to background processes; there is no more dependency on client side filtering. The MythTV server also boots with the host, and the first screen the host encounters is the GDM login. Now the system is secure. Passwords are required to enter the system as a user.