<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Phase Shift &#187; Weave</title>
	<atom:link href="http://phaseshiftllc.com/archives/tags/weave/feed" rel="self" type="application/rss+xml" />
	<link>http://phaseshiftllc.com</link>
	<description>Official Site of Phase Shift, LLC an IT Consulting Group from Baton Rouge, LA</description>
	<lastBuildDate>Fri, 26 Feb 2010 01:45:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Setting up a custom Weave 0.5 server</title>
		<link>http://phaseshiftllc.com/archives/2009/10/09/setting-up-a-custom-weave-0-5-server</link>
		<comments>http://phaseshiftllc.com/archives/2009/10/09/setting-up-a-custom-weave-0-5-server#comments</comments>
		<pubDate>Fri, 09 Oct 2009 20:37:53 +0000</pubDate>
		<dc:creator>derek</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Weave]]></category>
		<category><![CDATA[Weave 0.5]]></category>
		<category><![CDATA[Weave Server]]></category>

		<guid isPermaLink="false">http://phaseshiftllc.com/?p=463</guid>
		<description><![CDATA[Weave is a synchronization engine from Mozilla Labs for all your browser information (settings, history, bookmarks, etc, etc).  It is a free add-on for Firefox and you can freely use Mozilla&#8217;s servers  to store your information.  This guide, however, is for anyone interested in setting up their own secure Weave server. There are instructions on [...]]]></description>
			<content:encoded><![CDATA[<p>Weave is a synchronization engine from Mozilla Labs for all your browser information (settings, history, bookmarks, etc, etc).  It is a free add-on for Firefox and you can freely use Mozilla&#8217;s servers  to store your information.  This guide, however, is for anyone interested in setting up their own secure Weave server.</p>
<p>There are instructions on the Mozilla Labs places, but they are a bit scattered and it took some digging before I could get things working.  Hopefully this guide will give a simple single locations for anyone interested.</p>
<h3><strong>Assumptions</strong></h3>
<p>For this guide I will assume PHP 5.1+,  a working Apache 2 server with SSL, and MySQL (SQLite can easily be substituted here, it should be obvious where.  As Mozilla notes, whatever web server you use, WebDAV can&#8217;t be enabled on that server.</p>
<h3>Server Configuration</h3>
<p>First things, grab the latest version of the Weave Server from Mozilla Labs at <a href="http://hg.mozilla.org/labs/weaveserver" target="_blank">http://hg.mozilla.org/labs/weaveserver</a> in whichever format you prefer.  Extract the files into a folder accessible by your web server.  The &#8220;server&#8221; folder will be the web root, so we can go ahead an setup a virtual server configuration similar to the following example (replace the paths accordingly):</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> weave.my.domain:<span style="color: #ff0000;">443</span>&gt;
&nbsp;
<span style="color: #00007f;">ServerName</span> weave.my.domain
<span style="color: #00007f;">DocumentRoot</span> /var/www/weaveserver/server/
&nbsp;
<span style="color: #00007f;">ErrorLog</span> /var/log/apache2/weave-error.log
<span style="color: #00007f;">CustomLog</span> /var/log/apache2/weave-access.log combined
&nbsp;
SSLEngine <span style="color: #0000ff;">on</span>
SSLCertificateFile /path/to/server.cert.crt
SSLCertificateKeyFile /path/to/server.cert.key
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">Directory</span> <span style="color: #7f007f;">&quot;/var/www/weaveserver/server/&quot;</span>&gt;
&nbsp;
<span style="color: #00007f;">Options</span> <span style="color: #0000ff;">Indexes</span> <span style="color: #0000ff;">FollowSymLinks</span>
<span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">none</span>
<span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
<span style="color: #00007f;">Allow</span> <span style="color: #00007f;">from</span> <span style="color: #00007f;">all</span>
<span style="color: #00007f;">AuthType</span> Basic
<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Weave Server&quot;</span>
<span style="color: #00007f;">AuthUserFile</span> /path/to/auth/file
<span style="color: #00007f;">require</span> valid-<span style="color: #00007f;">user</span>
&nbsp;
&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
&nbsp;
<span style="color: #00007f;">Alias</span> /<span style="color: #ff0000;">0.5</span> /var/www/weaveserver/server/<span style="color: #ff0000;">0.5</span>/index.php
<span style="color: #00007f;">Alias</span> /<span style="color: #00007f;">user</span>/<span style="color: #ff0000;">1</span> /var/www/weaveserver/server/<span style="color: #00007f;">user</span>/<span style="color: #ff0000;">1</span>/index.php
&nbsp;
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</pre></div></div>

<p>As you can see from this Apache config, there are some file that need to be generated.  Specifically, an SSL Certificate and key, and a basic authentication file.  I will run through these briefly below, if you are good with generating these, just skip down a bit.</p>
<h3>Generating a Self-Signed SSL Certificate</h3>
<p>First, generate a key:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> server.key <span style="color: #000000;">1024</span></pre></div></div>

<p>Generate a certificate signing request (CSR):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> server.key <span style="color: #660033;">-out</span> server.csr</pre></div></div>

<p>Optional &#8211; At this point you can remove the password from the key if you wish&#8230; please be aware of the security risks before doing this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> server.key server.key.pass
openssl rsa <span style="color: #660033;">-in</span> server.key.pass <span style="color: #660033;">-out</span> server.key</pre></div></div>

<p>Finally, generate the certificate:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl x509 <span style="color: #660033;">-req</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span> <span style="color: #660033;">-in</span> server.csr <span style="color: #660033;">-signkey</span> server.key <span style="color: #660033;">-out</span> server.crt</pre></div></div>

<p>Make sure the Apache Virtual Host configuration paths match the locations of the key and certificate files.</p>
<h3>Creating a Password File</h3>
<p>Generate an htpasswd file using the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">htpasswd <span style="color: #660033;">-c</span> weaveserver.pwd</pre></div></div>

<p>You will be prompted to enter a password for the user you created.  Make sure to update the AuthUserFile path in the Apache Virtual Server config to point to this file.</p>
<p><strong>Note:</strong> You need to have the same user name(s) and password(s) in the htpasswd file as you plan on having setup in the Weave user database table (covered later).</p>
<h3>Database Setup</h3>
<p>Create a new database and create the two tables as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">DATABASE</span> WEAVE<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">USE</span> WEAVE<span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> <span style="color: #008000;">`wbo`</span> <span style="color: #FF00FF;">&#40;</span>
  <span style="color: #008000;">`username`</span> <span style="color: #999900; font-weight: bold;">varbinary</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">32</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008000;">''</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`collection`</span> <span style="color: #999900; font-weight: bold;">varbinary</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">64</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008000;">''</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`id`</span> <span style="color: #999900; font-weight: bold;">varbinary</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">64</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008000;">''</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`parentid`</span> <span style="color: #999900; font-weight: bold;">varbinary</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">64</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`predecessorid`</span> <span style="color: #999900; font-weight: bold;">varbinary</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">64</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`modified`</span> <span style="color: #999900; font-weight: bold;">decimal</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">12</span><span style="color: #000033;">,</span><span style="color: #008080;">2</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`sortindex`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`depth`</span> <span style="color: #999900; font-weight: bold;">tinyint</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">4</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`payload`</span> <span style="color: #999900; font-weight: bold;">longtext</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`payload<span style="color: #008080; font-weight: bold;">_</span>size`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">PRIMARY KEY</span>  <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`username`</span><span style="color: #000033;">,</span><span style="color: #008000;">`collection`</span><span style="color: #000033;">,</span><span style="color: #008000;">`id`</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #008000;">`parentindex`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`username`</span><span style="color: #000033;">,</span><span style="color: #008000;">`collection`</span><span style="color: #000033;">,</span><span style="color: #008000;">`parentid`</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #008000;">`modified`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`username`</span><span style="color: #000033;">,</span><span style="color: #008000;">`collection`</span><span style="color: #000033;">,</span><span style="color: #008000;">`modified`</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #008000;">`weightindex`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`username`</span><span style="color: #000033;">,</span><span style="color: #008000;">`collection`</span><span style="color: #000033;">,</span><span style="color: #008000;">`sortindex`</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #008000;">`predecessorindex`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`username`</span><span style="color: #000033;">,</span><span style="color: #008000;">`collection`</span><span style="color: #000033;">,</span><span style="color: #008000;">`predecessorid`</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #008000;">`size<span style="color: #008080; font-weight: bold;">_</span>index`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`username`</span><span style="color: #000033;">,</span><span style="color: #008000;">`payload<span style="color: #008080; font-weight: bold;">_</span>size`</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">ENGINE</span><span style="color: #CC0099;">=</span><span style="color: #990099; font-weight: bold;">InnoDB</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> <span style="color: #008000;">`users`</span>
<span style="color: #FF00FF;">&#40;</span>
 <span style="color: #008000;">`username`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">32</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">PRIMARY KEY</span><span style="color: #000033;">,</span>
 <span style="color: #008000;">`md5`</span> <span style="color: #999900; font-weight: bold;">varbinary</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">32</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
 <span style="color: #008000;">`email`</span> <span style="color: #999900; font-weight: bold;">varbinary</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">64</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
 <span style="color: #008000;">`status`</span> <span style="color: #999900; font-weight: bold;">tinyint</span><span style="color: #000033;">,</span>
 <span style="color: #008000;">`location`</span> <span style="color: #999900; font-weight: bold;">text</span><span style="color: #000033;">,</span>
 <span style="color: #008000;">`alert`</span> <span style="color: #999900; font-weight: bold;">text</span>
<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">ENGINE</span><span style="color: #CC0099;">=</span><span style="color: #990099; font-weight: bold;">InnoDB</span><span style="color: #000033;">;</span></pre></div></div>

<p>That should be it for the database!  Feel free to adjust the database name to your own liking, and be sure to grant select, select, insert, delete, and update permissions to whichever MySQL user you plan on accessing this with from weave.  In case anyone forgot the grant sytax:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">SELECT</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">INSERT</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">UPDATE</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">DELETE</span> <span style="color: #990099; font-weight: bold;">ON</span> weave.<span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">TO</span> <span style="color: #008000;">'myuser'</span>@<span style="color: #008000;">'localhost'</span><span style="color: #000033;">;</span></pre></div></div>

<p>If you are creating this user, be sure to set the password by adding &#8221; IDENTIFIED BY &#8216;mypassword&#8217; &#8221; on the end of the above statement.</p>
<h3>Weave Server Configuration</h3>
<p>Navigate to the weaverserver/server/user/1 folder.  Copy weave_user_constants.php.dist to weave_user_constants.php and set the following items:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_STORAGE_ENGINE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mysql'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">...</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_MYSQL_STORE_READ_HOST'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_MYSQL_STORE_READ_DB'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_MYSQL_STORE_READ_USER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_MYSQL_STORE_READ_PASS'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">...</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_AUTH_ENGINE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mysql'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">...</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_MYSQL_AUTH_HOST'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_MYSQL_AUTH_DB'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_MYSQL_AUTH_USER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_MYSQL_AUTH_PASS'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">...</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_REGISTER_STORAGE_LOCATION'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'weave.my.domain'</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>These settings are pretty obvious once you read over the comments.  The first group of settings is for the database that stores the synchronized data, and just sets the type and connection information.  The second is basically the same thing, but points to the database that has the table of users to authenticate against.  The final setting above only needs to be set if you are using the same database to house both the storage and authentication data.</p>
<p>Now do essentially the exact same steps for weaveserver/server/0.5/default_constants.php.dist.  That is, copy it over to default_constants.php and then edit the similar sections to set the connection strings for the authentication and storage database(s).  The only difference is that instead of specifying the &#8216;WEAVE_REGISTER_STORAGE_LOCATION&#8217;, which will not exist, set the following line if both the authentication and store tables are in the same database:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_SHARE_DBH'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you are using different databases, just leave this one alone.  Also, you can easily use Sqlite as well by setting the various &#8216;engine&#8217; variables to &#8216;sqlite&#8217; and configuring the path to the stores (this is pretty self explanatory once you read through the constants files).</p>
<h3>CAPTCHA</h3>
<p>If you want to use captcha when creating an account, you will need to grab a public and private key from <a href="http://recaptcha.net">http://recaptcha.net</a> and make some changes to the Apache and Weaver Server configs.  This is completely optional (just ignore the captcha field if you don&#8217;t set this up when creating a new user).<br />
Back in weaveserver/server/user/1/weave_user_constants.php set the following to 1:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WEAVE_REGISTER_USE_CAPTCHA'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now copy weaveserver/server/misc/1/weave_misc_constants.php.dist to weave_misc_constants.php and add in your public and private keys.  Finally, add an alias to your Apache config as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">Alias</span> /misc/<span style="color: #ff0000;">1</span>/captcha_html /server/misc/<span style="color: #ff0000;">1</span>/captcha.php</pre></div></div>

<h3>Test it!</h3>
<p>Now everything should be configured, so install the Weave add-on for Firefox if you haven&#8217;t already (<a href="http://labs.mozilla.com/weave/">http://labs.mozilla.com/weave/</a>).  At the time of writing this, the latest was 0.7.</p>
<p>Open a new tab in Firefox and type about:config and search for extensions.weave.clusterURL.  Set this to your Weave Server URL (i.e.  &#8220;https://weave.my.domain/&#8221;).  Make sure to include the trailing slash.<br />
Now open weave and go to the user creation screen.  At the bottom of the form box there is an option that says &#8220;Create my account with:,&#8221; select &#8220;A custom Weave server&#8221; and input your server into the textbox below (i.e. &#8211; &#8220;https://weave.my.domain/&#8221;).  Again here, make sure you include a trailing slash as the underlying code doesn&#8217;t check and append if needed.</p>
<p>If all goes well, you should be able to put in a username and have it tell you that it is available (if it says it is not available, and its not already in the database, check the log in the top right of the page under tools -&gt; debug log to see what the problem is).  If you didn&#8217;t setup captcha, just leave it blank and create your user once you filled in an email and password.  Now enter your pass phrase and you should be set!  Select what you would like to sync and how, then either wait or manually kick off a sync by going to &#8220;Signed in as &#8221; -&gt; &#8220;Sync now&#8221; in the upper right.  If everything went correctly, your data should be sent over SSL and encrypted into your server&#8217;s database.</p>
<h3>References</h3>
<p><a href="https://wiki.mozilla.org/Labs/Weave/0.5/Setup/Storage">Weave Storage / Server Setup</a><br />
<a href="https://wiki.mozilla.org/Labs/Weave/User/1/Setup">Weave User Setup</a><br />
<a href="http://labs.mozilla.com/weave/">Weave Page on Mozilla Labs</a><br />
<a href="http://www.akadia.com/services/ssh_test_certificate.html">Creating a Self Signed SSL Certificate</a><br />
<a href="http://httpd.apache.org/docs/2.0/programs/htpasswd.html">htpasswd Apache Reference</a></p>
]]></content:encoded>
			<wfw:commentRss>http://phaseshiftllc.com/archives/2009/10/09/setting-up-a-custom-weave-0-5-server/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
