Contents

Pre-Setup Considerations

It is strongly recommended that the Weave Server be set up under https, or behind a firewall with an https proxy in front of it. It uses standard http auth, which will send the password in the clear unless done over https.

The Weave Server requires PHP with PDO and JSON support installed. This should be the case if you are running PHP 5.1+. PDO will need drivers for whatever storage and authentications engines are used.

WebDav must not be enabled for this server - it intercepts some of the http packets and syncing will fail.

Setting up the Server

1) You can get the latest server from http://hg.mozilla.org/labs/weaveserver (there you can download it in different formats). Once things are fully established, we'll declare certain builds as stable, but for now assume all releases are beta quality. Unzip it into your html tree.

2) Edit your apache conf files to add the following:

Alias /0.5 <full path to weave directory>/server/sync/1.0/index.php

Don't forget to set up the weave directory in a virtual-host-directive (or similar), or else php will not work. (See sample virtual host config below)

3) Copy /server/sync/1.0/default_constants.php.dist to /server/sync/1.0/default_constants.php and edit it as described below. If you have mutiple hostnames, you can put override constant files into {HOST_NAME}_constants.php

Setting up Weave Authentication

In weave_constants.php at the beginning (e.g. directly after the license-block)

Other Constants

define('WEAVE_PAYLOAD_MAX_SIZE', '<bytes>');

Caps the size (in bytes - watch out for large unicode characters!) of a payload.

define('WEAVE_SHARE_DBH', '1');

If both the storage engine and authentication engine are using the same database, setting this makes both engines use the same database handler rather than opening different ones. Note that SQLite cannot use the same db for authentication and storage.

Sample virtual host config

Sample Virtual host config for a server having SSL enabled and requiring http authentication. For debian placed in /etc/apache2/sites-enabled/, weave server directory located at /var/www/weaveserver/server/.