Saturday, October 14, 2006

Deploying PHP with Capistrano

If you are looking for an automated way to deploy your php application you'd problably stumble over this blog post. So did I.

I wanted to try this on ubuntu Dapper. But there was no ruby, so I did:

apt-get install ruby
apt-get install rdoc

Then i fetched the rubygems archive from:
http://rubyforge.org/frs/?group_id=126

Follow the instructions of the README. I got an error message the first time i tried to install it because the rdoc package was missing from my ubuntu installation (see above the apt-get).

setup.rb failed too. After further google research i found this comment:

At this point you must MAKE SURE you install gems from the top
of directory you unpacked it to, otherwise you will get an error
stating

.... ./post-install.rb has failed
"No such file or directory - pkgs/sources"

Hope this helps someone, Thanks everyone.


Then i followed the instructions on simplistic complexity i mentioned in the beginning.

gem install capistrano
...

On Dapper i needed an additional apt-get install libopenssl-ruby for capistrano to install.

You still have to make sure that pubkey authentification is setup correctly for your target server. You need subversion (at least the client) installed there too, if you want to use capistranos default deployment procedure and your php application's filesytem layout should be ruby-like in order to make things easy.

The fact that your doc_root changes to /path_to_your_php_app/current is mentioned as well on simplistic complexity. Once you are set up it makes life lot easier.