canmove, Confirmed users
1,173
edits
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 | == 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. | ||
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 | ||
</pre> | </pre> | ||
== 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 === | |||
Create the mysql database. Add the following tables: | |||
<pre> | <pre> | ||
| Line 41: | Line 107: | ||
</pre> | </pre> | ||
Edit your apache conf files to add the following: | |||
<pre> | <pre> | ||
SetEnv WEAVE_MYSQL_STORE_HOST <db host> | |||
SetEnv WEAVE_MYSQL_STORE_DB <db name> | |||
SetEnv | SetEnv WEAVE_MYSQL_STORE_USER <db username> | ||
SetEnv | SetEnv WEAVE_MYSQL_STORE_PASS <db password> | ||
SetEnv | |||
SetEnv | |||
</pre> | </pre> | ||
== Optional Apache Parameters == | == Optional Apache Parameters == | ||