Sunday, March 27, 2011

Package the Weave Server - 0.1 (Manual Install)

Hello everyone, it's been a while since my last blog post. Unfortunately I had some health issues to deal with, but things have improved and I will be posting details on my packaging project followed by the labs I've completed.

Milestone 0.2 will deal with the actual packaging of Weave and the bugzilla process, for this post (0.1) I will give you some brief information on what Weave is and how to successfully install and configure it manually.

Package the Weave Server Wiki (For more details)

What is Weave?

Weave is the server component for a product you be aware of called Firefox Sync (now standard with Firefox 4.0). It allows you to backup and sychronize data from your browser or mobile client to Mozilla servers or custom ones. My project is to package Weave for inclusion on the official Fedora repos to assist in the automation and management of custom Weave servers.

Weave consists of two main components: reg-server and sync-server. The first (reg-server) handles account registration and modifications while sync-server handles data collection and management.

Installation:

Before we begin the install a number of packages will be required. Weave requires MySQL and Apache running, PHP including mbstring and mysql driver. We will also be using mercurial to clone the necessary files from Mozilla.
yum install php php-mbstring php-mysql mysql mysql-server mercurial httpd
Next we will clone the reg/sync files from Mozilla.
hg clone http://hg.mozilla.org/services/sync-server
hg clone http://hg.mozilla.org/services/reg-server
This will create directories for both Weave components. Move these to your preferred install directory as your the apache weave conf file will point to it later.

MySQL Setup

Next we will setup the weave database and management user account. I have an SQL script (modified from Anna Sobiepanek's original) which you can use to automate the process. Please download the script from my matrix account.

Note: This script will create the management account: 'weave' with a default password of 'weave', if you wish change the following line in the script with the password of your choice, otherwise leave it default:
CREATE USER 'weave'@'localhost' IDENTIFIED BY 'weave';
Make sure you've setup your root MySQL (or account with permission to create users and database) account and apply the script with the following command:
mysql -u'dbuser' -p'dbpass' < '/script/path/weave.sql'
Configuring Constants

Next we need to configure the PHP constant files for both the sync and reg components. Begin by copying the template .dist files to the same folder without the extension:
cp 'install/path/sync-server/1.1/default_constants.php.dist' '/install/path/sync-server/1.1/default_constants.php'

cp '/install/path/reg-server/1.0/weave_user_constants.php.dist' '/install/path/reg-server/1.0/weave_user_constants.php'
For the purposes of this install we will leave the constants at their default values unless you setup a custom password for the weave MySQL account. Please change the following define statements if you've done so

sync-server/1.1/default_constants.php
if (!defined('WEAVE_MYSQL_STORE_READ_PASS')) { define('WEAVE_MYSQL_STORE_READ_PASS', 'weave'); }
if (!defined('WEAVE_MYSQL_AUTH_PASS')) { define('WEAVE_MYSQL_AUTH_PASS', 'weave'); }
reg-server/1.0/weave_user_constants.php
if (!defined('WEAVE_MYSQL_AUTH_PASS')) { define('WEAVE_MYSQL_AUTH_PASS', 'weave'); }
Apache Config

Create a config file in /etc/httpd/conf.d/ called 'weave.conf' and enter the following aliases pointing to your install directories. The multiple aliases are required for backwards compatibility with older weave clients.
Alias /1.0 <path to install directory>/sync-server/1.1/index.php
Alias /1.1 <path to install directory>/sync-server/1.1/index.php
Alias /user/1.0 <path to install directory>/reg-server/1.0/index.php
Alias /user/1 <path to install directory>/reg-server/1.0/index.php
Make sure to restart the apache service after saving the config file:
service httpd restart
Client Setup (Firefox 4.0 Sync)

Mozilla has a handy Firefox Sync setup video on their website. Point the client to your custom server (http://localhost/) and test your custom weave server by creating an account and syncing.

*Note: Due to a bug with Firefox Sync Client, make sure to include the forward slash / at the end of your server address. Otherwise sync will not work.

Wednesday, January 12, 2011

Build-from-Source Lab

I've chosen the following GNU software packages for this lab: barcode & httptunnel
 

I started the lab by group installing dev tools/libraries as instructed (
yum groupinstall "Development Tools" "Development Libraries").
 

I ran into no issues configuring and compiling the source code for these two GNU applications. The make times are as follows:
 

Barcode: 
real 0m0.555s 
user 0m0.182s 
sys 0m0.179s

HttpTunnel:

real 0m0.592s
user 0m0.182s 

sys 0m0.256s

Introductions are in order.. (Communications Lab)

Hello Everyone,

I'm a final semester student in the CTYC program here at Seneca College (and fresh off a 8-month co-op stint). While I'm not necessary a frequent Linux or open-source user I hope this course will still be of benefit (and may even change my usage patterns), plus I have a brand new Android device and could use some tips :D.


Seneca Wiki Profile
Fedora Wiki Profile
IRC Nickname: jpmorgan (also Learn ID)

IRC Chat Log:

<jpmorgan>    Hello Everyone
<ctyler>    hi jpmorgan
<jpmorgan>    Hi! I'm one of your new SBR students. Nice to see people are still chatting (however frequent :P).
<ctyler>    jpmorgan: oh, the channel is quiet now, it will get busier :-)
<jpmorgan>    Haha good to hear. I'm Justin btw. When is the peak of "activity" usually?
<ctyler>    depends on what's going on with projects, it varies considerably. and some semesters use IRC more than others...
<Willaim>    x86_64 mean fedora arm?
<ctyler>    x86_64 means 64-bit PCs
<ctyler>    i386 or i686 means 32-bit PCs
<ctyler>    armv5tel means arm, but you need an arm builder to do that
<ctyler>    any of the CDOT machines (iraq, chile, romania, australia, ...) can do x86_64 or i386
<jpmorgan>    I'm curious about the kinds of ARM projects to be found in the CDOT (and SBR class). Do students ever get to work on something Android related?
<jpmorgan>    Or is it strictly Fedora ARM projects?
<ctyler>    jpmorgan: well, Andriod is basically another Linux distro, a much smaller one
<jpmorgan>    True
<ctyler>    but a number of the Android pieces are in Fedora
<ctyler>    and basically all of Meego
<ctyler>    the Linux ARM projects share a lot of info back and forth
<jpmorgan>    Oh great. So there may be a chance some of us might get to play around with Android/Meego packages. Regardless it's still great to get hands-on with ARM.
<jpmorgan>    Just purchased a Nexus S so that's peaked my interests haha.
<ctyler>    jpmorgan: cool, I got an HTC Desire not long ago. Very cool environment :-)
<jpmorgan>    ctyler: Yeah I noticed it in your hands during the first class. I would have loved that device but I'm on WIND so I had to find something compatible lol.