Bookmark Sync in Firefox

I just discovered the Bookmarks Synchronization extension for Firefox, thanks to this page. In order to get it working, I had to figure out how to setup a WebDAV server. Setting up the WebDAV server proved to be the most challenging part, and it is that information that I am trying to post here.

I’m using Apache2 running under Debian Linux. As such, these configuration steps are Debian-specific. They should generalize without too much difficultly though.

The first thing that is necessary is to enable mod_dav in your Apache installation. Fortunately, the version that ships with Debian makes it easy to add modules (it pre-compiles a healthy number of them, but leaves them uninstalled: you must create symlinks to install – the sprit is similar to /etc/init.d and /etc/rcN.d).

cd /etc/apache2/mods-enabled
ln -s ../mods-available/dav_fs.conf ../mods-available/dav_fs.load ../mods-available/dav.load .

I suggest restarting apache at this point and using phpinfo() to make sure the module is actually loaded.

Now, it is time to create the folder where you’re going to put the WebDAV stuff. I suggest keeping this tree separate from your web tree. So, for example, if your website is in /var/lib/apache2/www/, then you might put WebDAV in /var/lib/apache2/webdav/. Create the webdav directory and change its owner to the www-data user.

Next, I edited the /etc/apache2/sites-enabled/000-default file and added an appropriate Directory directive:

# Added for web_dav stuff
Alias /webdav/ "/var/lib/apache2/webdav/"
<directory /var/lib/apache2/webdav/>
DAV On
Options None
AuthType Basic
AuthName "WebDav Access"
AuthUserFile "/var/lib/apache2/users"
<limitexcept GET HEAD OPTIONS>
require user bookmark
</limitexcept>
</directory>

Now, authentication won’t be possible unless the /var/lib/apache2/users file actually exists and contains a user.

htpasswd -cm /var/lib/apache2/users bookmark
New password: xxxxxxxx
Re-type new password: xxxxxxxx

If you have any troubles, go into /etc/apache2/sites-enabled/000-default and change LogLevel to Debug. Have a look at /var/log/apache2/*

Please remember that every time you change the Apache’s configuration files you must restart Apache. This is accomplished by running as root: /etc/init.d/apache2 restart.

I then configured the Firefox Bookmark Sync plugin by selecting Tools -> Extensions, selecting “Bookmarks Synchronizer 1.0.1,” clicking the “Options” button, and filling in the fields as follows:

Check the “HTTP” radio button.
Host: http://www.myhost.com
User: bookmark
Password: xxxxxxxx
Path: /webdav/xbel.xml

Most of the problems that I had turned out to be related to typos. Be careful!

Michael Rollis has posted some stylish things to enhance your WebDAV Bookmarking experiences. Go check it out.

Resources that helped me to figure this out:
webdav.org
mod_dav page

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s