Skip to content

Installation: Windows

swannodette edited this page Sep 13, 2010 · 18 revisions

These are instructions for Window XP. If you have tried this on Vista please let us know what went wrong.

Installing Python 2.6

You should use the appropriate 2.6 installer from here. Once you’ve installed you need to update your path. Open the Control Panel via the Start Menu. Select the Performance and Maintenance icon. Then select the System Icon. In the window that open select the Advanced tab. At the bottom there is a button Environment Variables, click on this. In the System Variables group there should be an entry called Path. Append ;C:\Python26\ to the list, the starting semicolon here is just a delimiter.

Installing Git

If you are a windows developer you should install Git anyway even if you are working from the official Developer Alpha releases because you get a nicely packaged bash shell which you should use over the Windows Console. You can ignore the specific Git instructions in other sections if you are using a Developer Alpha.

Install the latest version of msysgit. This will put a handy link on your desktop for starting up a bash shell interface. git is very popular in the open source community and most install instructions assume you are running bash or some similar command line shell. When we refer to the terminal we really mean the git bash shell application.

Installing Java 1.6

Install the latest 1.6 Java SE Development Kit.

Getting ShiftSpace

Clone the main shiftspace repository into your Sites folder on your machine by typing the following after launching terminal:

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

Then the run the following to pull in the various git submodules required by shiftspace:

cd shiftspace
git submodule init
git submodule update

Your clone is now ready to go.

Installing CouchDB

In the past installing CouchDB on Windows was a fairly arduous affair. Things have become much simpler with CouchDB 0.10. Mark Hammond now maintains a single-step installer, get it here. In order to run CouchDB you’ll need to have the required C/C++ DLLs. You can get those here.

Once it’s done installed you should verify that nothing went wrong. You should see CouchDB in the Start Menu under the Apache CouchDB folder. Select it to startup CouchDGB. You’ll see a startup window that hopefully doesn’t spew out any errors.

Point your browser at http://localhost:5984/_utils. You should see Futon, the GUI to CouchDB.

Python dependencies

Run the following at the terminal:

cd ~/Desktop/shiftspace
python shifty.py installdeps

This installs all of the Python libraries the ShiftSpace backend needs to run. You might notice there is couchdb-lucene .jar as well. We’ll get to that in a moment.

Initializing the database

Now we need to initialize the database. Make sure that CouchDB is running. Type the following into your terminal:

cd ~/Desktop/shiftspace
python shifty.py initdb

You should see some output as new documents are added to the databse.

You should point your web browser to http://localhost:5984/_utils/database.html?shiftspace%2Fmaster to see that the shiftspace database is there and in fact populated with design documents.

Configuring couchdb-lucene

Now that you have CouchDB up and running, you should configure couchdb-lucene. In order for Lucene to index CouchDB and provide full text search capabilities you’ll need to edit your CouchDB local.ini file. This is located in C:\Program Files\Apache Software Foundation\CouchDB\etc\couchdb. Open this file in your favorite text editor and 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                                                                                                      

[update_notification]
; IMPORTANT: your path to the java executable may different
indexer=\"C:\Program Files\Java\jdk1.6.0_11\bin\java.exe\" -jar \"C:\Documents and Settings\Owner\Desktop\shiftspace\server\couchdb-lucene-0.4-jar-with-dependencies.jar\" -index

; To create an admin account uncomment the '[admins]' section below and add a
; line in the format 'username = password'. When you next start CouchDB, it                                        
; will change the password to a hash (so that your passwords don't linger                                                    
; around in plain-text files). You can add more admin accounts with more                                                      
; 'username = password' lines. Don't forget to restart CouchDB after                                                       
; changing this.                                                           
;[admins]                                                                                                               
;admin = mysecretpassword                                                                                                      

[external]
; IMPORTANT: your path to the java executable may be different
fti=\"C:\Program Files\Java\jdk1.6.0_11\bin\java.exe\" -jar \"C:\Documents and Settings\Owner\Desktop\shiftspace\server\couchdb-lucene-0.4-jar-with-dependencies.jar\" -search

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

IMPORTANT You may need to change the two lines that call into the couchdb-lucene jar so that the java path portion of the path actually matches the location of java on your machine. If CouchDB is running shut it down and start it up again to verify there were no errors.

Wrapping up CouchDB configuration

Point your browser at http://localhost:5984/shiftspace%2Fmaster/_fti. You should see some json output like the following (it doesn’t matter if it doesn’t completely match).

{
    "current": true,
    "disk_size": 1909,
    "doc_count": 4,
    "doc_del_count": 1,
    "fields": [
        "summary",
        "modified",
        "private",
        "draft",
        "createdBy",
        "created",
        "domain",
        "userName",
        "streams",
        "displayName",
        "href"
    ],
    "last_modified": 1252875399000,
    "optimized": false
}

Preparing to start the server

In order for the ShiftSpace script to build properly between page refreshes the dependencies between all the JavaScript source files must be determined as well as setting the url. In the future you won’t need to set the url since it should just default to http://localhost:8080. Until then you have to run the following in a terminal:

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

Starting the server

You can now start the ShiftSpace server. Again make sure that the CouchDB is running.

Let’s start the actual ShiftSpace server. Type following into a new terminal:

cd ~/Desktop/shiftspace
python shifty.py runserver

You should see some output that CherryPy is starting up. In your browser goto http://localhost:8080/. Don’t forget the trailing slash. You should see a greeting.

Now to really verify that things are working point your browser to to http://localhost:8080/sandbox/. Don’t miss the trailing slash (we’ll fix this later). You should be able to open the ShiftSpace Console by typing the shift key plus the space key together. You should see a Login tab. In the login tab there is a Join subtab. Select this. Enter your information and click submit (sorry the enter key doesn’t work yet).

You should now be logged in. Open up the Spaces menu in the lower left. Click on the Notes Space button. You should see an empty note fade onto the page. Type some text and click the save button. You should see your new shift appear in the Console.

Congratulations! You’ve successfully installed ShiftSpace 1.0. Please refer to the developer manual if you’d like to know more about developing spaces.

Recap

Whenever you want to hack on ShiftSpace, first start up CouchDB.

Then type the following at a new terminal:

cd ~/Desktop/shiftspace
python shifty.py runserver

You can then point your browser to http://localhost:8080/sandbox/, and that’s all there is to it.

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.