Tag Archives: passenger

37signals also saw the benefits of AWS

37signals moved TaDaList to run on pretty much the same things I’m using: EC2, EBS, Elastic IPs, Apache, Passenger. They also started from the same Ubuntu Intrepid images. 🙂

Joshua posted more info on their setup in the comments section of the blog post:

Joshua Sierles 28 Nov 08

Matt,

Our custom image is based on the Ubuntu Intrepid images from Alestic. We install useful EC2 gems and base packages, bundle, then provision each instance by role. Working with EC2 is so easy, we don?t see much value in using a third-party provider for our scale.

Yaroslav,

EBS and Elastic IPs were the primary motivation for moving to EC2 . We use EBS extensively: for MySQL data, logs and local repository mirrors. Performance so far is excellent. Snapshotting volumes is a breeze and makes setting up MySQL slaves and staging environments really easy.

[From Ta-da List on Rails 2.2, Passenger And EC2 – (37signals)]

Using Phusion Passenger in Facebook apps development

Ray pointed me to a RailsCast on how to use Passenger for local development, it literally took me 2 minutes to setup. If you work on multiple Ruby on Rails applications, you should definitely do it.

There is however one problem on this approach, since the default passenger.pref config relies on virtual host, you can’t really setup SSH port forward to forward something to one of the virtual hosts, and this is important as this is how most of us develop Facebook applications locally. To get Passenger and Rails Facebook apps to work, you have to:

  • open up httpd.conf ask Apache to listen to another port:
Listen 81
  • add another named virtual host, here I’m adding port *.81:
<IfModule passenger_module>
  NameVirtualHost *:80
  NameVirtualHost *:81
  Include /private/etc/apache2/passenger_pane_vhosts/*.conf
</IfModule>
  • In the configuration for that Facebook app, change it to respond to all traffic on the new port (81 in this case):
<VirtualHost *:81>
  ServerName app_name.local
  DocumentRoot "/Users/ayn/work/app_name/public"
  RailsEnv development
  RailsAllowModRewrite off
  <directory "/Users/ayn/work/app_name/public">
    Order allow,deny
    Allow from all
  </directory>
</VirtualHost>

Now you can setup your tunnel to forward to localhost (or 127.0.0.1 if you use SSHKeychain) port 81 and it should work. Add more ports if you work on multiple Facebook apps at the same time.