Introduction

While waiting for my google wave invite like the rest of the planet today, I thought I’d walk through a Google Wave Federation Prototype Server (WFPS) build installed as a small ubuntu virtual machine. Why? Because waiting for a google wave invite isn’t nearly geeky enough.

The WFPS server is implemented as a jabber component, and should work with any xmpp/jabber-server that supports this functionality. Make sure to read through the documentation available on the project homepage. The instructions there walk through setting up WFPS against OpenFire. As I’m more familiar with ejabberd, I’ll walk through that install instead.

Configure the VM and Install the base OS

Create your virtual machine with a single 8GB drive. After all the components are installed, this build still weighs in under a gig. Java is a bit heavy on the memory, I started with 512 RAM. YMMV. As a VM, it’s easy enough to adjust this if you need additional resources later.

I’m going to be using ubuntu JeOS, a version of ubuntu released by canonical, which is configured specifically for virtual appliances. Get it here.

Once installed, check for updates and move on to install the dependencies.

sudo apt-get update && sudo apt-get upgrade

Install Dependencies

Java

Java, and all of it’s dependencies, are a requirement for the service:

sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-fonts

agree (if you want to continue) with the Distributor License for Java (DLJ).

At this point it’s always good to double check what version of java will be called by default.
To see the current configuration and possibilities run the following:

sudo update-java-alternatives -l

As we’ve installed Sun Java 6, go ahead and run the following to set it as the default:

sudo update-java-alternatives -s java-6-sun

ejabberd

I’m using ejabberd, so you’ll need to install and configure it for use.

sudo apt-get install ejabberd

There are three changes you’ll need to make in the ejabbard configuration file. Open /etc/ejabberd/ejabberd.cfg with the CLI editing tool of your choice and make the following three changes:

1. add your username to admin section:


% Users that have admin access. Add line like one of the following\
% after you will be successfully registered on server to get\
% admin access:
{acl, admin, {user, "theron"}}.

2. change the “hostname” to reflect the FQDN (if you’re going to make your ejabberd service publicly available) or the actual hostname of your server.

% Host(s) name: (replace for your hostname(s))
% Old {host, "localhost"}. option is equivalent to
% {hosts, ["localhost"]}.
{hosts, ["wave.conrey.org"]}.

3. We need to set up ejabberd to accept connections from the the GWFP component. Add the following lines in the “listen” directive (I added this right below the Yahoo listener):

%Google Wave Component
{8888, ejabberd_service, [{access, all}, {shaper_rule, fast},
    {hosts, "wave.conrey.org",[{password, "wavecomponentpasswd"}]}]},

Change the hostname to the hostname of the server, and change the password to a unique value.
NOTE: Make sure to keep track of this passwd, as you’re going to need it when you start the wave-server.

Start the service:

 /etc/init.d/ejabbard start

Make sure the service started!

sudo ejabberdctl status

should return a value of:

Node ejabberd@$hostname is started.  Status: started
ejabberd is running

register your username with ejabberd

Register your username against the local service (adding your username to the config didn’t register you, only preset your rights).
The syntax for this is: ejabberdctl register $username $hostname $password.

 sudo ejabberdctl register theron wave.conrey.org $passwd

Restart the instance to get the admin username change:

sudo /etc/init.d/ejabberd restart

you can check again to make sure the service is running correctly.

web check of ejabberd

At this point you should be able to log into your ejabberd service now via a webpage to ensure that everything to here is working properly. point a web browser at the ejabberd interface:

http://$hostnameOrFQDN:5280/admin/

your username will be username@hostname, and the password is what you defined when you registered your account with the ejabberd service.

ant and mercurial

You’ll need ant and mercurial installed to get and compile the source:

sudo apt-get install ant mercurial

Download and compile WFPS.

Grab the source:

hg clone https://wave-protocol.googlecode.com/hg/ wave-protocol

change to the wave-protocol directory and compile:

cd wave-protocol
ant

This will end in a line that says:

BUILD SUCCESSFUL

and a Total time value. Any other output and something didn’t work.

build encryption certificates
Certificates will be required for this server, The most current instructions on how to complete this step can be found on the project page here.

I used the self signed certs. As this is still only a test environment, I’m not going to be connecting to other wave servers outside my lab.

Starting the server

Last step is starting the wave server. Change to the wave-protocol directory you checked out before and start the server with the following command. Change the values wave.conrey.org.key and wave.conrey.org.cert to whatever files you created in the last step and the secret to whatever password you chose when editing ejabberd.cfg for this service.

sudo java -jar dist/fedone-server-0.2.jar --client_frontend_hostname=wave.conrey.org\
--client_frontend_port 3456 --xmpp_component_name=wave --xmpp_server_hostname=wave.conrey.org\
--xmpp_server_ip=127.0.0.1 --xmpp_server_port=8888 --xmpp_server_secret wavecomponentpasswd\
--xmpp_server_ping="" --waveserver_disable_verification=true --certificate_private_key=wave.conrey.org.key\
 --certificate_files=wave.conrey.org.cert --certificate_domain="wave.conrey.org"\
--waveserver_disable_signer_verification yes

I’d recommend putting all that in a shell script to start automatically after the server boots. Once this is running the last thing for this walkthrough is to connect to the wave server.

Client connection


Hard parts over folks, from here we just launch the client with some parameters and we’re off.

java -jar dist/fedone-client-0.2.jar theron@wave.conrey.org wave.conrey.org 3456

that’s the jabber userid(to include the server name) the wave-server and the port (as defined in the start variable for the server service)

It should log you in, return to you a prompt:

theron@wave.conrey.org>  

what now?!

From here, you’re off! I’ll write some more notes around this later, check out the official docs, there are piles of information out there. For now, I’m going to check my inbox and see if I got my official google wave invite yet!