Thursday, April 29, 2010

Setup WeaveSync test server on localhost

Google requires us to keep track of our GSoC project work, therefore I decided to use my dear old (or maybe not so old..) blog to report my weekly work :) This is my first report..

GSoC work : Week 1 (26th Apr to 2nd May)

I had two options for a test server for Weave. The Weave 1.0 full server, which comes in two parts (sync server and registration server) or the Weave Minimal server. Since the Weave wiki itself mentions that the full server is complicated to setup and advises people to try the minimal server instead, I decided to setup the minimal server first and then try my luck with the full server.

The full server can be setup with a MySQL database, however the minimal server requires SQLite. Both servers require SSL setup on the webserver (i am using Apache2).

How to setup SSL on Apache2

SSL (new version is TLS) is a cryptographic protocol for providing end-to-end security for communication over the Internet. While looking for a tutorial to setup SSL I came across this article http://www.symantec.com/connect/articles/apache-2-ssltls-step-step-part-1 which gives a good explanation of how SSL works.

For setting up SSL I referred the tutorials http://beeznest.wordpress.com/2008/04/25/how-to-configure-https-on-apache-2/ & http://www.debian-administration.org/article/Setting_up_an_SSL_server_with_Apache2.

The steps were:

1. Enable SSL on apache2
2. Generate key and certificate
3. Edit my virtual hosts configuration file ( /etc/apache2/sites-available/default ).

This gave me the following configuration: http://pastebin.mozilla.org/720065

Now I can access https://localhost from the browser (first time you do this you get a security warning, then you need to add an exception and save the server certificate).


Setup Weave Minimal Server on localhost

I got the server from here : http://tobyelliott.wordpress.com/2009/09/11/weave-minimal-server/ and setup after following the instructions in the ReadMe file. I had to install SQLite3 which I did by using 'apt-get install sqlite3'.

Now I could run weave extension using my custom test server. For the server URL i specified https://localhost/weave_minimal/ and everything worked (well not the first time, because I hadn't added an exception for https://localhost the first time!) just as if I were using the Mozilla server.

The SQLite database is the weave_db file and to view the data I used the SQlite database browser application.


Setup Weave 1.0 full server

I setup the full server on locahost as well in case I require it for future testing. This was harder to setup than the minimal server.

I setup the database with MySQL and followed the installation guides https://wiki.mozilla.org/Labs/Weave/Sync/1.0/Setup (for sync server) & https://wiki.mozilla.org/Labs/Weave/User/1.0/Setup (for registration server). The server requires php to support both PDO & JSON. I had to add PDO support to my existing php5 installation to get the server working.

To run weavesync addon with full server, I specified the server URL as https://localhost/ (end '/' is always required).

I could browse the sync data using the MySQL Query Browser program.

Right now I'm using the minimal server, because there is still an error with the sync server of the full server installation (the sync server test doesn't run - it gives Authentication error and although syncing happens with the extension there is an error in the 'id' field that specifies the type of payload (history, tabs, prefs etc.) being synchronized. I hope to fix this problem soon.

This week I also got to know some of the Seamonkey developers and how they communicate over IRC:) I also had my first official meeting with my mentor, Robert Kaiser to discuss the project. During this meeting it was decided to complete feed status syncing first before working on mail status syncing due to the problems that will arise in mail status sync especially for POP3 mail downloads. Since tab sync is already functional, it was decided have a suitable overlay for 'Tabs from other computers' and test the functionality with it. I will be working on this next week.

So how was my first week as a GSoC student? Definitely exciting!:) It's my first time working with the opensource community and the Seamonkey community was very kind and welcoming:) I also had the opportunity to reply to some Seamonkey user queries this week and try out some IRC commands like /me !:D

That's it for week no. 1 but hope to have much more to report in the coming weeks (15 more to go!):)

1 comment:

  1. Minimal server and Weave Minimal server do a masterful job of explaining why we are at the start of a new era of radically increasing standards of living throughout the world. Harini Sirisena your article is essential reading for anyone looking for a better tomorrow.
    online homework assignments

    ReplyDelete