Posts about deployment

Setting up Phusion Passenger on my slice

As my slice is running low on memory, running multiply mongrel processes really isn't an option any more(I am too cheap to pay for more memory, in these trying economic times). Phusion passenger comes to the rescue! Phusion passenger is exactly what the rails community needed for its deployment story. 

So I follow the instructions:
gem install passenger
When I did this my slice just hung indefinitely. It turns out that when gem updates the index of ruby gems, it downloads the entire index and puts it in memory, and this didn't fit in my tiny 256m I had on my slice. This thread ended up saving the day for me. I was able to do:
gem install passenger -B 1000000
it was slow but it worked.
Next up was installing the apache2 module:
passenger-install-apache2-module
First, it failed to find my apache2 installation and asked my to install it. I told it where it was by doing:
export APXS2=/usr/local/apache2/bin/apxs
Next, it didn't find the Apache Portable Runtime(APR). I told it where it was by doing:
export APR_CONFIG=/usr/local/apache2/bin/apr-1-config
Then, it didn't find the APU(whatever that is, I stopped caring). I did:
export APU_CONFIG=/usr/local/apache2/bin/apu-1-config
After all that, and running passenger-install-apache2-module again, it worked! 
Next I setup the virtual host entries. I created the file /usr/local/apache2/conf/apps/tobyho.conf with these contents:
<VirtualHost *:80>
        ServerName tobyho.com
        DocumentRoot /var/www/apps/mywiki/public
        <Directory "/var/www/apps/mywiki/public">
                Options FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

And now I got the wiki running on mod_rails. Yea!

Posted by Toby about 1 year ago about deployment, passenger, programming and rails (0 comments)

capistrano and deprec

I got slicehost recently to host osspinions, and started getting into using capistrano and deprec to deploy the app and set up the box. You can think of capistrano as a remote control enabled make, and deprec as bunch of tasks build on capistrano that automates the setting up of everything from your user account to deploying your rails app - for ubuntu only. I was really impressed, just 4 commands installed everything up to the rails stack. But the deployment of the app was harder, a lot harder, in fact. I had to install ferret(which I just more recently ditched), FreeImage for image science, and rcov as a gem, and ruby-openid as a gem as well. These things are the ones that I could not stuff into the vendor directory and have it work. After that, for ferret I had to use symlinks to share the index directory, and for uploaded files I had to symlink them too because the deprec setup is such that every deployment you do creates a brand new directory for the new release. This is good in many ways, but it also creates some complications. I heard the guys on the slicehost podcast talk about this and they pretty much confirmed as much: it's hard to make deprec work for everybody because everybody does things differently, Oh well. Capistrano, on the other hand, is pretty nice. I wrote a python script at my last job to build and deploy a Java app, and if I had came across capistrano then, I would have definitely used it instead and would have saved me a lot of work.
Posted by Toby over 2 years ago about deployment, programming and rails (0 comments)