Friday, 25 June 2010

Friday, 20 November 2009

Passenger + Sinatra Tip: DocumentRoot is Always /public

I was getting 403 errors after deploying my newest Sinatra app with Passenger.

Turns out Passenger assumes and requires a /public folder.

This app is so tiny and new, it didn’t have one yet – so I was pointing Passenger at the app’s root. Resulting in the 403 errors.

Solution: Create an empty /public folder and restart Apache. Ta Da. Like magic.

If you’re still having issues – confirm your LoadModule passenger_module path is correct, mine looks like this:

After updating the Passenger gem to 2.2.7, my LoadModule path was way off, not helping the deployment troubleshooting efforts.

Thursday, 15 October 2009

Sunday, 22 March 2009


This weekend I made some significant head way on one of my key 2009 projects:

Right now, Kernest is also the most likely candidate for my 5 minute Ignite Mpls presentation.

Sunday, 8 March 2009

Introducing: RE07.US – The Greenest URL Shortener


According to a recent post by, a link in Twitter is clicked for 5 minutes, then completely ignored.

That got me thinking about all the wasted short urls out there. So many tinyurl,,, et al, links just collecting dust after all that initial clicking.

Seems so wasteful considering “the current economic climate”. Maybe, we don’t need all those URLs. Maybe we should tighten our belts and limit ourselves to 1 short url – and continually reuse it.

With that in mind, I built HTTP://RE07.US. It’s 1 short url that we can all share.

All long URLs get shortened to the same link: RE07.US. And, it will be shortened to that – until someone else shortens their long URL to RE07.US. And so on and so on.


Saturday, 7 March 2009

Deploying Sinatra on Joyent’s Shared Accelerators with Thin

On Thursday afternoon, I had an idea for just about the smallest web app I could think of (since then, I’ve even cut out a couple features). It didn’t make sense to use all of Ruby on Rails for this considering how tiny it was.

Seemed like a great opportunity to try out Sinatra1

  1. Write the app
  2. Vendor Sinatra and Rack (that’s just good practice)
  3. Submit a ticket requesting a port
  4. Add a file to your app’s directory (for Rack) containing the following

    require 'vendor/rack-[VERSION]/lib/rack'
    require 'vendor/sinatra-[VERSION]/lib/sinatra'
    :run => false,
    :environment => :production
    require 'app'
    run Sinatra::Application
  5. Add a config.yml file to your app’s directory for Thin containing the following

    environment: production
    chdir: /path/to/app
    user: [USERNAME]
    port: [PORT]
    pid: /path/to/domain/tmp/
    rackup: /path/to/app/
    log: /path/to/domain/logs/thin.log
    max_conns: 1024
    timeout: 30
    max_persistent_conns: 512
    daemonize: true
  6. Follow the Setting up and Configuring Lighttpd instructions on the Joyent Wiki (See update below)
  7. Add another Bootup Action for Thin
    Startup thin -s 1 -C /path/to/config.yml -R /path/to/ start
    Shutdown thin -s 1 -C /path/to/config.yml -R /path/to/ stop
  8. Follow the Proxying to a Port instructions on the Joyent Wiki
  9. 1. If the time I spent building this app was a cocktail, it’d be 1 part programming, 2 parts design, 3 parts deployment. That’s a huge part of why I wrote this post.

UPDATE: March 8, 2009
My gut says Lighttpd + Thin is redundant, so I’ve turned Lighttpd off.