There is a neat project that I have wanted to get involved with for a while called AltLaw. AltLaw is a free open source project developed by the Columbia Law and Technology program. Resources for the project are located at the Law Commons Trac Page.
I am trying to get the AltLaw “stack” working on my Mac OS X machine. So here we go:
1) Download the file http://anilmakhijani.com/altlaw-config.zip and unzip it. I will refer to the location of this unzipped file as {alt-law-config-directory} throughout the rest of this tutorial.
2) Next, we have to get the Rails front end working.
(Prerequisites: sqlite, git)
% git clone git://github.com/lawcommons/altlaw-websearch.gitInitialize altlaw-websearch/.git % gem install -v=2.1.0 rails % gem install htmlentities % gem install BlueCloth % gem install solr-ruby % gem install ruby-debug % gem install chronic % gem install json % cd altlaw-websearch % mkdir log % chmod -R 644 log/ % cp {alt-law-config-directory}/altlaw-config/rails-config/* config/database.yml % rake db:migrate
In the file config/environment.rb, change the line:
SOLR = Solr::Connection.new("http://localhost:8196/v3/solr")
to:
SOLR = Solr::Connection.new("http://localhost:8983/solr/")
and:
ExceptionNotifier.exception_recipients = ['errors@altlaw.org']
to:
ExceptionNotifier.exception_recipients = ['myemail@example.com']
% ./script/server
This starts the Rails front end at http://localhost:3000
* To run the Rails front end in production mode do the following:
(Additional prerequisites: mysql)
update config/database.yml with the proper configuration for you database
% rake db:migrate RAILS_ENV=production % rake sass:update % RAILS_ENV=production rake asset:packager:build_all % ./script/server -e production
3) Finally, we need Solr:
The following tutorial seemed to work perfectly on my Mac OS X: http://lucene.apache.org/solr/tutorial.html
% wget http://mirror.x10.com/mirror/apache/lucene/solr/1.2/apache-solr-1.2.0.tgz % tar xvfz apache-solr-1.2.0.tgz % cd apache-solr-1.2.0 % cp -r example/ alt-law/ % cd alt-law/ % cp {alt-law-config-directory}/altlaw-config/solr-config/* solr/conf/ % java -jar start.jar
This starts solr at http://localhost:8983/solr/.
This set of instructions worked for me. I would love feedback on what it would take to get this to work on non Mac OS X system.
Leave a Reply