Steve’s Ubuntu Weblog

Mainly (but not only) about Ubuntu

Quote-1

Nothing is so simple that it cannot be misunderstood.

Albert Einstein

20 February, 2007 Posted by | Funny | Leave a comment

Apache2 SSI (Server Side Includes) Part II

OK, now I have found out how to enable the SSI correctly, and it works! So forget my last post and take the code out of httpd.conf, leaving it blank again. Then set up the following symlink

sudo ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled

Then modify /etc/apache2/sites-available/default by adding the bold italics code

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

</Directory>

Then do a restart with

apache2 -k restart

This time it works a treat. To test, write a simple test script and save it in /var/www as test.shtml, ie-
<html>
<head>
<title>SSI Test 1</title>
</head>
<body>
<h1>SSI Test 1</h1>
<p>
Das aktuelle Datum ist: <!--#echo var="DATE_LOCAL" -->
</p>
</body>
</html>

Then point your browser at http://localhost/test.shtml (if localhost is the name of your server, if not use the server name instad of localhost).

5 February, 2007 Posted by | Ubuntu | 1 Comment

Apache2 SSI (Server Side Includes)

I have seen some good scripts to use that require SSI to be enabled but I couldn’t figure how to enable it. Several sites tell you to add the following to your /etc/apache2/httpd.conf file. (There is a warning in this httpd.conf that informs that the file is only for backwards compatability so I think there has to be a better way to do this but until I get it working I will do it this way).

Options +Includes
AddType text/html .shtml
AddHandler server-parsed .shtml

OK, I did that and nothing happened. The Apache Tutorial: Introduction to Server Side Includes website offers this advice “to permit SSI on your server, you must have mod_include installed and enabled.” but doesn’t tell you how to install and enable mod_include. I couldn’t find mod_include on any of the Ubuntu repositories but eventually found this command which worked so I guess the module is installed with Apache2 by default but not enabled.

sudo a2enmod include
apache2 -k restart

My test.shtml file is still not working but I’m slowly getting there. I will edit this post when I get SSI working to show how I did it.

4 February, 2007 Posted by | Ubuntu | 5 Comments

SQL Example Databases

I am playing with mysql at the moment and have found these two sample databases. world and sakila which save a lot of time entering data to test SQL queries.

You can download them, together with instructions for installation from http://dev.mysql.com/doc/#sampledb

4 February, 2007 Posted by | Ubuntu | Leave a comment

Mondo Differential Backup

I have been using Mondo for years now, in fact because Novell screwed Mondo up is the main reason I left SuSE. However I have always done a full backup which takes a long time and uses a DVD for my system so a differential backup should be a good idea. I just couldn’t seem to find out whether a differential backup was a delta to the last differential or to the last full backup. I have carried out a few test and it seems that it is indeed a delta to the last full backup, so that you can delete all of the differential backups except for the last one.

The differential for my system is only about 200MB and so fits easily on a CD. I am now making a full Mondoarchive once a week and differential backups daily. I save the to an .iso file and burn them onto DVD/CD here are my commands, first the full backup-
mkdir -p /media/usbdisk/Backups/`date +%F`;sudo mondoarchive -Oi -F -g -E "/media/hdb1 /media/usbdisk /home/steve/Entertainment /home/steve/.Trash /home/,Trash-root /root/.Trash /tmp" -d /media/usbdisk/Backups/`date +%F` -s 4300m
and second the differential backup –
mkdir -p /media/usbdisk/Backups/`date +%F`;sudo mondoarchive -D -Oi -F -g -E "/media/hdb1 /media/usbdisk /home/steve/Entertainment /home/steve/.Trash /home/,Trash-root /root/.Trash /tmp" -d /media/usbdisk/Backups/`date +%F` -s 4300m

2 February, 2007 Posted by | Ubuntu | 6 Comments