The bibliographic manager Zotero lets you sync your collection to a remote server, which is handy when you work on more than one machine. They provide space for free which is plenty for my citations; but to sync the attachments (pdfs, web page snapshots, etc.), the 100mb of free file storage isn’t enough: I’ve got 95mb of stuff already. You can, however, sync the attachments to any WebDAV-accessible storage. I have a home Ubuntu server with RAID storage for the family digital treasures (we run a backup service for all the machines in the house using the excellent BackupPC package), so it made sense to use that. Here’s a quick list of the steps involved.
- Set up a Linux server. I’ve been using Ubuntu Netbook Edition on an Eee box for a couple of years with no complaints. Ours is pink; we call it “panther”. (You could probably do all this on a Mac or Windows machine that’s on all the time, if you prefer).
- Buy a couple of large USB drives and set them up as RAID 1 (or buy more and get more redundancy). Software RAID is easy to set up in Ubuntu. Mount the RAID array at e.g. /raidarray and create the directory which the WebDAV service will use as its home, e.g. /raidarray/webdav.
- Now that you’ve got some storage and a server, you need WebDAV. Install Apache, and add WebDAV capabilities to it. Make sure the Apache user has read/write permissions on the webdav directory.
- One of the points of using your own server is that you can encrypt your network traffic using a self-signed certificate, avoiding the significant cost of a real one. Set up a self-signed certificate in Apache.
- Now you need to make your server available on the Interwebs. If you use a cable or DSL service, you probably don’t have a fixed IP address, which makes you hard to find, since your provider may change your IP address frequently and unpredictably. The solution is dynamic DNS, which allows your server to notify the DNS when its IP address changes. Set up a free account at DynDNS.com. You will also have to install a little package on your server that will check your current IP address periodically and report changes to DynDNS.
- Set up your router to direct incoming traffic on your chosen port to your server. The settings are probably under the games and applications tab of your router config interface. Choose a high port number (make the script kiddies work).
- Finally, put it all together: set up the virtual host in Apache that will serve your WebDAV repository. My virtual host configuration looks something like this, with service at https://mywebdav.dyndns.org:12345/webdav/ (not my real host), the RAID array mounted at /raidarray, and the certificate authority and other ancillary stuff in /var/www_dyndns:
Restart Apache and you should be good to go. With your browser you can visit https://mywebdav.dyndns.org:12345/webdav and see the contents of your directory, after you accept the certificate and log in. You should also be able to mount that directory as a network drive from any client.
To use it for Zotero, create a directory named “zotero” in the “webdav” directory, and then go to the “Sync” tab in the Zotero preferences, turn on file syncing using WebDAV, and give it your address. Do the same in other machines you want to sync. As Zotero syncs, you’ll see the /raidarray/webdav/zotero directory fill up with .prop and .zip files.
Caveats and lessons learned:
- I found that the process that determines the current IP address timed out a lot due to load on DynDNS’s servers. I got around this by installing a script on my own website (where this blog is hosted at Dreamhost) for it to visit instead. Instructions were easy to find.
- Visiting your server using DynDNS from within your home network can be problematic. I couldn’t get it to work with my first router: requests would just hang. When that router died and I replaced it with a Cisco Valet, the problem went away.
- Your server will be unreachable during the interval between a change of IP address by your provider and the next update to DynDNS. This hasn’t been a problem for me yet.
- The self-signed certificate encrypts your traffic, but it creates a theoretical vulnerability to spoofing. Buy a real one if you’re worried. I wouldn’t use this to store sensitive personal information, though.
- If you have problems, check the Apache logs. The first thing to check is permissions: can Apache read and write to the Zotero directory?