Those of you out there that work on multiple computers, for example a work computer(s) and personal computer(s), know how much of a pain it is to keep your bookmarks synchronized. Over the years I’ve built a pretty large library of bookmarks. What makes it annoying is that I’ll add a bookmark on my home computer, for example, then go to work and realize that I need the link that’s on my home computer. What I’ve done in the past is just e-mail my bookmarks.html file to myself but synchronizing it and keeping it up to date is just not a lot of fun.
I could use del.icio.us and while I do have an account on there I don’t want it to be my primary bookmark store. I tend to prefer having my bookmarks be private and on my computer.
I figured their had to be a Firefox plugin that took care of this. I know I’m not the only one to have this problem. I found a few of them including OnlineBookmarkManager and FoxMarks. I didn’t get that far in to the OBM extension because I found that FoxMarks just uses WebDAV to push and pull bookmark files. Perfect! But where would it store them? I really don’t want to store my bookmark file on a 3rd party server, especially one that could go down at any time since both initiatives look more like hobby sites than being attached to a more permenant entity. Plus, there’s just the privacy issues. Enter Apache and mod_dav and mod_dav_fs.
So, I set out to configure WebDAV support on Apache. At least on my distro on my VPS at RimuHosting (tell ’em I sent you if you sign up!) the Apache configuration comes with the DAV modules loaded, although no directories are configured for DAV support. You’ll want to look for these lines in your httpd.conf file:
If they’re not there, make sure the shared objects are present and then add the references to them in the file. If you don’t have the referenced files then you’ll need to do more research to get your server configured for WebDAV support.
After this you’ll want to create a directory in your HTML folder. Let’s just say you call it /bookmarks. Create that directory and then make sure that the user that the httpd process runs as has the ability to write to this directory. For me, it was easiest to just give the apache user ownership of that sub-folder.
Next, you’ll need to configure this folder as a DAV enabled folder. You’ll do this by adding a section such as this to your httpd.conf file:
In the section above, DAV on tells HTTP that the web_dav_fs module will be enabled for this location. It also says that authorization will use basic HTTP authentication and to use the passwd file in /etc/httpd/conf/passwd (at least this is where I keep mine) for authorization. The last line is critical in that it tells Apache that a valid user is required to access this location. This keeps the wrong people from reading and overwriting your bookmarks.
The next step is to create the passwd file in your server’s configuration directory. Make sure the user the server is running as has access to the location of this file. I used htpasswd with the -c option so that it would create the file in the directory and encrypt it properly.
Now, you’re ready to go. Go in to Foxmarks and cancel out of the wizard (The Foxmarks menu is in the Bookmarks menu if you’re unable to find it). Set the username and password for the user you are going to use to access the bookmarks. Then go to the other menu and put your server name or IP address in the server field. Next, the path should be the location you set above in the Location field. I went ahead and put my username after the bookmarks directory so that I could patition them out via users if I ever give friends the opportunity to store their bookmarks on my server.
To test it, just click the Maintenance section’s, “Upload Now” button. If you get an error message then check the Apache server’s error log file. That’s configured in your httpd.conf file. If it says password mismatched make sure you have the ability to read the password file you specified. If your password file isn’t where you says it is the Apache error log will tell you that specifically.
I did encounter a synchronization error after trying it out between two servers and this is known error that you can read about here: http://www.foxcloud.com/wiki/Foxmarks:_Error:_Precondition_Failed. There is a procedure at the bottom of this page that discusses a setting you can set in Firefox’s configuration (in the address bar type about:config) that will make this a non-issue. Read the limitations in the documentation, however. Once I had set that property I had no problems synchronizing between my two machines. If you don’t feel like synchronizing you can also just always upload download bookmarks.
I think that should just about do it. Drop me an e-mail or leave a comment if you have problems and I’ll try to do what I can to help.