Enable SSI on Apache2 under Ubuntu

Tested on:
– Ubuntu Linux 10.10 Maverick Meerkat (2010-11-21)
– Ubuntu Linux 7.10 Gutsy Gibbon
– Ubuntu Linux 6.06 Dapper Drake
– Ubuntu Linux 5.10 Breezy Badger

 

1)  Optional: Install the Apache2 httpd server if not already installed.

sudo apt-get install apache2

2) Create the following symlink.
sudo ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled

3) Open the /sites-available/default file and add the text with the yellow background.
sudo gedit /etc/apache2/sites-available/default

...
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order allow,deny
allow from all
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</Directory>
...

4) Restart Apache2 and create a SSI test file (ssi-test.shtml) and save it in the directory /var/www/.

sudo apache2ctl restart

sudo vim /var/www/ssi.shtml

<html>
<head>
<title>SSI Page</title>

</head>
<body>
<!--#echo var="DATE_LOCAL" -->
</body>
</html>

5) Test SSI in your web browser.
http://localhost/ssi.shtml

If your browser displays the local date (eg Monday, 29-Jul-2013 14:32:58 BST), SSI would be working.

Yeah !!

nJoy 😉

 

Leave a Reply

Your email address will not be published. Required fields are marked *