Friday, August 14, 2009

Starting the Beta Site

‹prev | My Chain | next›

Yesterday I established a linode node and seeded it with a complete data set (thanks to couch_docs). I really wanted to get the whole application up and running yesterday—it really would have been cool to get it all up and running in a night. Alas this was not to be—but only because I got a late start.

Before I get back to sysadmin work, I transfer my old DNS records to Linode. My current shared hosting site has no provisions for modifying DNS, whereas Linode does. Adding the beta site:



Nice! I kinda miss mucking about with BIND zones, but that was so easy (the transfer of the domain and the addition of the new host) that I am not going to complain too much.

Continuing, then, with sysadmin work, I clone my git repositories:
$ mkdir repos
$ cd repos/
$ git clone git://github.com/eee-c/couchdb-lucene.git
$ git clone git://github.com/eee-c/eee-code.git
I compile my older, hacked up version of couchdb-lucene with a simple invocation of maven:
$ mvn
After much downloading and compiling, the couchdb-lucene jar is ready.

CouchDB will use that jar if instructed to do so in the local.ini file (sudo vi /etc/couchdb/local.ini):
#...
[couchdb]
os_process_timeout=60000 ; increase the timeout from 5 seconds.

[external]
fti=/usr/bin/java -jar /home/cstrom/repos/couchdb-lucene/target/couchdb-lucene-0.3-SNAPSHOT-jar-with-dependencies.jar -search

[update_notification]
indexer=/usr/bin/java -Dcouchdb.lucene.commit.min=50 -Dcouchdb.lucene.commit.max=100 -jar /home/cstrom/repos/couchdb-lucene/target/couchdb-lucene-0.3-SNAPSHOT-jar-with-dependencies.jar -index

[httpd_db_handlers]
_fti = {couch_httpd_external, handle_external_req, <<"fti">>}
That should do it for the CouchDB configuration, but I will certainly smoke test it when the site is running.

Next, to actually get the application running, I need some gems:
$ sudo gem install sinatra haml pony RedCloth
That is enough to get the application started:
$ ruby eee.rb
== Sinatra/0.9.4 has taken the stage on 4567 for development with backup from WEBrick
[2009-08-15 01:40:58] INFO WEBrick 1.3.1
[2009-08-15 01:40:58] INFO ruby 1.8.7 (2009-06-12) [i486-linux]
[2009-08-15 01:40:58] INFO WEBrick::HTTPServer#start: pid=31662 port=4567
I would rather Sinatra get its backup from thin:
$ sudo gem install thin
And...
== Sinatra/0.9.4 has taken the stage on 4567 for development with backup from Thin
>> Thin web server (v1.2.2 codename I Find Your Lack of Sauce Disturbing)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4567, CTRL+C to stop
To get it running from port 80, I use authbind. With authbind, I need execute access to /etc/authbind/byport/80:
$ sudo apt-get install authbind
$ sudo touch /etc/authbind/byport/80
$ sudo chmod 700 /etc/authbind/byport/80
$ sudo chown cstrom /etc/authbind/byport/80
Finally:
$ authbind ruby eee.rb -p 80
== Sinatra/0.9.4 has taken the stage on 80 for development with backup from Thin
>> Thin web server (v1.2.2 codename I Find Your Lack of Sauce Disturbing)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:80, CTRL+C to stop
I still need to get this running as a daemon, but it runs:



And, just to be absolutely sure, the promised smoke test that couchdb-lucene searching is working as well:



Check it out for yourself!

beta.eeecooks.com

Postscript: shortly after announcing this on Twitter, GoogleBot began indexing the site (that was amazingly quick). Since this is a beta site, I use robots.txt to prevent indexing:
# vi public/robots.txt
# We're in beta here!
User-agent: *
Disallow: /

No comments:

Post a Comment