After getting a lot of trouble with the Xmarks sync on the quit old iceweasel that is installed on my desktop machine (Debian lenny), I decided to look for alternatives and found the firefox sync server. To run my own sync server I followed the installation instructions from mozilla and also some other nice guides available via websearch. Here are the basic steps:
get the necessary packages:
aptitude install python-dev mercurial sqlite3 python-virtualenv
Create a new user for the sync server using the apropriate commands and include www-data, the apache user, in the newly created group to give acces to the python script.
install the server from source:
$ hg clone https://hg.mozilla.org/services/server-full
$ cd server-full
$ make build
Create some directories as there are
- data for the sqlite files – I will switch to mysql very soon
- tmp for some temporary python files
- logs just to keep the synchronisation logs seperate from the rest – I am not sure about access rights when writing directly to the logs directory
And now edit the configuration files:
$ vi sync.wsgi
[..]
os.environ['PYTHON_EGG_CACHE'] = '/path/to/tmp/python-eggs'
[..]
$ vi development.ini
[..]
[handler_syncserver_errors]
class = handlers.RotatingFileHandler
args = (‘/path/to/logs/sync-error.log’,)
[..]
$ vi etc/sync.conf
[..]
[storage]
backend = syncstorage.storage.sql.SQLStorage
sqluri = sqlite:////path/to/data/usersettings.db
[..]
[auth]
backend = services.auth.sql.SQLAuth
sqluri = sqlite:////path/to/data/usersettings.db
[..]
fallback_node = https://
[..]
And finally add the directives for apache to access the wsgi interface:
WSGIProcessGroup ffsync
WSGIDaemonProcess ffsync user=ffsync group=ffsync processes=2 threads=25
WSGIPassAuthorization On
WSGIScriptAlias /ffsync /home/ffsync/server-full/sync.wsgi