September, 1752

Did you know that the month of September got short-changed 11 days in the year 1752? Yep, you went to bed on Wednesday, September 2, and woke up on Thursday, September 14! This is because of reorganizing the Gregorian calendar or some such. Mindless trivia, I guess. It’s neat to see that the computer relays it nicely:

    August 1752            September 1752         October 1752
 S  M Tu  W Th  F  S    S  M Tu  W Th  F  S    S  M Tu  W Th  F  S
                   1          1  2 14 15 16    1  2  3  4  5  6  7
 2  3  4  5  6  7  8   17 18 19 20 21 22 23    8  9 10 11 12 13 14
 9 10 11 12 13 14 15   24 25 26 27 28 29 30   15 16 17 18 19 20 21
16 17 18 19 20 21 22                          22 23 24 25 26 27 28
23 24 25 26 27 28 29                          29 30 31
30 31

WebDAV

One of the up-and-coming web publishing tools is… not what you’d expect! Pretty much anything that can save a file to disk! Anything, that is, that can be extended to save a file with the WebDAV protocol. DAV stands for “Distributed Versioning and Authoring”. This particular topic will house my notes on getting WebDAV set up with my apache server, and getting clients to use it. Currently there’s a pretty extensive list of clients that support it, such as Microsoft Office and OpenOffice. See my notes on OpenOffice and others in the rest of the article…

Apache Setup
For Apache 2.2.0, these are the general settings that are needed/suggested for DAV functionality. (earlier versions of apache also support DAV, I just happen to be on 2.2.0 at the moment)

LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so
DavLockDB /usr/site/www/logs/DAVlock.db
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

Take note with the DavLockDB line – you can’t just create that file and be done, because that file is not even used! It creates a .dir and a .pagfile with that prefix. Best to let apache own the directory the files are in, but you can probably pre-make and chown them…

Next, on a location-by-location basis, enble DAV:

Alias /davtest /usr/site/www/davtest/www
<Directory /usr/site/www/davtest/www>
    Dav on
    AuthType Digest
    AuthName DAV-upload
    AuthUserFile "/usr/site/apache-2.2.0/user.passwd"

    # Allow universal read-access, but writes are restricted to the admin user.
    <LimitExcept GET OPTIONS>
        require user admin
    </LimitExcept>
</Directory>

This is nice – authentication is required for DAV modification methods, but reading, such as is done by the webserver, requires no authentication.

OPEN OFFICE 2.0
The first thing you should do is change the options to use the Open/Save dialogs from OpenOffice instead of Windows (or Linux? I am not sure how they behave) because the Windows ones won’t let you save a new file to a DAV site. Open a blank document and go to Tools - Options - OpenOffice.org - General and check the “Use Openoffice.org dialogs” checkbox.
Now when you save a file (html, text, spreadsheet, etc), when you create the filename, simply enter the full path to the DAV file, such as http://mercury.guyton.net/davtest/testing.html. For saving a file, it’s the same thing, just enter the full path of the DAV site if the browser is not focused there already.

To load an existing file, it’s similar, and I believe works with either the openoffice or windows load dialogs. Better to stick with the openoffice ones though, so you can save new files.

One down side to OpenOffice was that it did not support digest authentication. We had to revert to Basic auth, which does not encrypt the password well. If it’s over SSL, that’s fine, but most users should be able to use HTTP and digest…

This still does not address images, though…. or other random file types.

How to create a favicon

Favicons are the custom images that are displayed in the location bar for websites that create them. They are also sometimes shown in your bookmarks/favorites.

So how do you create them? They are not simple BMP files, but almost. If you have a UNIX machine, you can create a favicon if you have the netpbm package installed. Here is the command to do it, assuming you already have a bmp file of the image you want (16 x 16 pixels):

bmptoppm favicon.bmp | ppmtowinicon > favicon.ico

Open Source Antivirus – Clam AV

Check this out – Clam AntiVirus (http://clamav.net) is an open source antivirus package, and runs on UNIX. It easily hooks into sendmail, and can scan all incoming mail, including contents of zip files as well as following html links back to their source to see if there is malicious intent on the web site. I like looking in my “viruses” mailbox to see what it filtered out that day. But wait, there’s more… What about Windows?

In addition to scanning email on UNIX, there are command line programs you can use to scan files or directories, which means you get antivirus capability to whatever programs you develop. NICE.

But it doesn’t end there – there’s a Windows port as well – http://www.clamwin.com. This can be installed and scan files and directories on your PC. Like the UNIX version, it checks the internet for virus signature updates and can be configured to download them automatically. Automatically up to date!

The one down side about clamwin is that it does not scan programs as they are run, catching viruses in the act. But wait, it’s open source, right? YES! So there are other programs out there that leverage ClamWin to do exactly what is needed. Winpooch (http://winpooch.free.fr/home/index.php) by itself will stop suspicious programs from doing things they shouldn’t, but also has hooks into ClamWin if installed, and will scan files for viruses before they are run. SWEET! There is also a Firefox extension that hooks into ClamWin and scans files as they are downloaded to make sure there are no viruses in them. (The current extension does not work with the latest version of Firefox, but good things are still to come, to be sure).

Open source rocks!