Skip to content

Installation: Linux

swannodette edited this page Sep 13, 2010 · 22 revisions

These are instructions for Ubuntu 9.0.4. Please send us a message if you have install instructions for other version of Ubuntu or other versions of Linux.

Installing Python

Ubuntu 9.0.4 comes installed with Python 2.6. However you need to install setuptools:

cd ~
mkdir downloads
cd downloads
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c9.tar.gz#md5=3864c01d9c719c8924c455714492295e
tar -xvzf setuptools-0.6c9.tar.gz
cd setuptools-0.6c9
sudo python setup.py install

Installing Git

If you are working with official Developer Alpha releases you can ignore all instructions about Git.

You need the latest version of Git. We recommend installing from source by downloading the tar.gz here.

Installing Java

ShiftSpace uses Lucene to handle full text search. Lucene is built on Java.

sudo aptitude install openjdk-6-jdk

Getting ShiftSpace

If you are working with official Developer Alpha releases you can ignore all instructions about Git.

From a terminal type the following:

cd ~
git clone git://github.com/ShiftSpace/shiftspace.git

Now we need to check out the right branch and bring in the other repositories:

cd ~/shiftspace
git submodule init
git submodule update

Introducing Shifty

Installing the dependencies

Run the following at a terminal to install the ShiftSpace Python dependencies.

cd ~/shiftspace
sudo python shifty.py installdeps

Installing CouchDB

The best way to run CouchDB on linux is to just install it via aptitude. These instructions were taken from Jan Van Ryswyck excellent tutorial here.

Installing the Couch dependencies

First install all of the dependencies:

sudo aptitude install automake autoconf libtool subversion-tools help2man spidermonkey-bin build-essential erlang erlang-manpages libicu38 libicu-dev libreadline5-dev checkinstall libmozjs-dev wget
sudo apt-get install libcurl4-gnutls-dev

Get the CouchDB source:

cd ~
mkdir src
cd src
svn co http://svn.apache.org/repos/asf/couchdb/trunk couchdb

Build CouchDB:

cd couchdb
./bootstrap
./configure --bindir=/usr/bin --sbindir=/usr/sbin --localstatedir=/var --sysconfdir=/etc
make && sudo make install

Verify that everything went okay by starting up couchdb:

sudo couchdb

Launch FireFox and point the browser at http://localhost:5984/_utils/

Configuring CouchDB

Editing local.ini

Edit the file /etc/couchdb/local.ini with your favorite text editor. Replace it’s contents with the following:

; CouchDB Configuration Settings

; Custom settings should be made in this file. They will override settings
; in default.ini, but unlike changes made to default.ini, this file won't be
; overwritten on server upgrade.

[couchdb]
;max_document_size = 4294967296 ; bytes
os_process_timeout=60000 ; 60 seconds for couchdb-lucene

[httpd]
;port = 5984
;bind_address = 127.0.0.1

[log]
;level = debug                                                                                                                                                                                                  

[external]
; CHANGE THIS LINE, username should be set to your username
fti=/path/to/python /home/username/shiftspace/server/couchdb-lucene/tools/couchdb-external-hook.py

[httpd_db_handlers]
_fti={couch_httpd_external, handle_external_req, <<"fti">>}

Initializing the database

Run the following at a terminal:

cd ~/shiftspace
python shifty.py initdb

This create a CouchDB database called “shiftspace” and populate it with the initial design documents.

Preparing to start the server

In order for the ShiftSpace script to build between browser refreshes ShiftSpace needs to know the dependency relationship between all the different JS files. It also needs to know the url where ShiftSpace will be running.

Run the following at a terminal:

cd ~/shiftspace
python shifty.py configure http://localhost:8080

Starting the server

We can finally start the server, run the following at the terminal:

cd ~/shiftspace
python shifty.py runserver

Launch FireFox and point the browser at http://localhost:8080/sandbox/.

Recap

Whenever you want to hack on ShiftSpace you need to first start CouchDB, then start up the builtin ShiftSpace webserver (CherryPy). At that point you point your browser at http://localhost:8080/sandbox/ and start hacking.

GreaseMonkey

If you have GreaseMonkey (and especially if you have a older version of ShiftSpace running) make sure to use the GreaseMonkey Manage User Scripts Window (you can get to it by right-clicking on the GreaseMonkey icon in the lower right corner of your browser) to exclude whatever domain ShiftSpace is running on – i.e. http://localhost:8080/* if you followed this tutorial.