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

no edit summary
No edit summary
Line 5: Line 5:
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.
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.


== Setting up the Weave Server (Sqlite backend) ==
== Setting up the Server ==


1) Unzip the weave_server.zip directory into the location you plan to serve the files from.
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:
3) Edit your apache conf files to add the following:
Line 15: Line 13:
<pre>
<pre>
Alias /weave/0.3 <full path to weave directory>/index.php
Alias /weave/0.3 <full path to weave directory>/index.php
SetEnv WEAVE_STORAGE_TYPE sqlite
SetEnv WEAVE_SQLITE_DIRECTORY <path to stores directory>
</pre>
</pre>


== Setting up the Weave Server (Mysql backend) ==


1) Unzip the weave_server.zip directory into the location you plan to serve the files from.
== Setting up Weave Authentication ==
 
Add the following to your apache conf:
 
<pre>
SetEnv WEAVE_AUTH_ENGINE [sqlite|mysql|none]
</pre>
 
=== Sqlite ===
 
Add the following parameter to your apache conf:
 
<pre>
SetEnv WEAVE_SQLITE_AUTH_DIRECTORY <path to stores directory>
</pre>
 
additionally, under the same user as your apache, create the users table
 
<pre>
$ sqlite3 <path to stores directory>/_users
SQLite version 3.4.0
sqlite> create table users (username text primary key, md5 text);
sqlite> .quit
</pre>
 
=== Mysql ===
 
Create the mysql database. Add the following tables:
 
<pre>
create table users
(
username varchar(32) primary key,
md5 varchar(32)) engine=InnoDB;
</pre>
 
Edit your apache conf files to add the following:
 
<pre>
SetEnv WEAVE_MYSQL_AUTH_HOST <db host>
SetEnv WEAVE_MYSQL_AUTH_DB <db name>
SetEnv WEAVE_MYSQL_AUTH_USER <db username>
SetEnv WEAVE_MYSQL_AUTH_PASS <db password>
</pre>
 
== Setting up Weave Storage ==
 
Add the following to your apache conf:
 
<pre>
SetEnv WEAVE_STORAGE_ENGINE [sqlite|mysql]
</pre>
 
=== Sqlite ===
 
Add the following parameter to your apache conf:
 
<pre>
SetEnv WEAVE_SQLITE_STORE_DIRECTORY <path to stores directory>
</pre>
 
To create a user db, run the following php code:
 
<pre>
<?php
  setenv(WEAVE_SQLITE_STORE_DIRECTORY, $your_path);
  $db = new WeaveStorageMysql($username, $auth_obj->get_connection());
  $db->create_user($username);
?>
</pre>
 
=== Mysql ===


2) Create the mysql database. Add the following table:
Create the mysql database. Add the following tables:


<pre>
<pre>
Line 41: Line 107:
</pre>
</pre>


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


<pre>
<pre>
Alias /weave/0.3 <full path to weave directory>/index.php
SetEnv WEAVE_MYSQL_STORE_HOST <db host>
SetEnv WEAVE_STORAGE_TYPE mysql
SetEnv WEAVE_MYSQL_STORE_DB <db name>
SetEnv WEAVE_MYSQL_HOST <db host>
SetEnv WEAVE_MYSQL_STORE_USER <db username>
SetEnv WEAVE_MYSQL_DB <db name>
SetEnv WEAVE_MYSQL_STORE_PASS <db password>
SetEnv WEAVE_MYSQL_USER <db username>
SetEnv WEAVE_MYSQL_PASS <db password>
</pre>
</pre>


== Optional Apache Parameters ==
== Optional Apache Parameters ==
canmove, Confirmed users
1,173

edits