Services/Sync/Server/Archived/0.3/Setup: Difference between revisions

From MozillaWiki
< Services‎ | Sync‎ | Server‎ | Archived
Jump to navigation Jump to search
(New page: == Pre-Setup Considerations == It is strongly recommended that the Weave Server be set up under https, especially if you are planning to use Apache basic authorization for access control....)
 
mNo edit summary
Line 4: Line 4:


The Weave server doesn't handle authentication, which can be done through any method you choose. Nor does it require authentication (unless the USER_MATCH variables are set, in whch case the server requires HTTP_AUTH_USER to be passed through).  
The Weave server doesn't handle authentication, which can be done through any method you choose. Nor does it require authentication (unless the USER_MATCH variables are set, in whch case the server requires HTTP_AUTH_USER to be passed through).  
The Weave Server requires PHP with PDO and JSON support installed. This should be the case if you are running PHP 5.1+.


== Setting up the Weave Server ==
== Setting up the Weave Server ==

Revision as of 21:23, 14 October 2008

Pre-Setup Considerations

It is strongly recommended that the Weave Server be set up under https, especially if you are planning to use Apache basic authorization for access control.

The Weave server doesn't handle authentication, which can be done through any method you choose. Nor does it require authentication (unless the USER_MATCH variables are set, in whch case the server requires HTTP_AUTH_USER to be passed through).

The Weave Server requires PHP with PDO and JSON support installed. This should be the case if you are running PHP 5.1+.

Setting up the Weave Server

1) Unzip the weave_server.zip directory into the location you plan to serve the files from.

2) Create your directory for the stores. Make sure that the folder is writeable by the apache user, and add it to open_basedir in your php.ini file.

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

Alias /weave/0.3 <full path to weave directory>/index.php
SetEnv WEAVE_DB_DIRECTORY <path to stores directory>

Optional parameters:

SetEnv WEAVE_USER_MATCH_READ 1

Requires the http-authenticated user to match the name of the user in the path in order to read from the store (recommended)

SetEnv WEAVE_USER_MATCH_WRITE 1

Requires the http-authenticated user to match the name of the user in the path in order to write to the store (recommended)

SetEnv WEAVE_AUTO_CREATE_USER 1

If the user in the path doesn't exist, automatically creates the account. If you wish to manually create accounts, see creating accounts, below.

Testing the Weave Server

The load_data.pl script will run a series of tests against your server, creating, modifying, selecting from and deleting a collection. Make sure to change the three parameters at the top before running it.

Creating Accounts

If WEAVE_AUTO_CREATE_USER is set, then a user account will be created on the first request. If not, the following code snippet (which can be run outside of the apache environment) will allow you to create an account:

<?php

require_once 'weave_storage.inc';
$db = new WeaveStorage($USERNAME,1);
$db->set_path($WEAVE_DB_DIRECTORY);
$db->create_user_path();
$db->initialize();

?>