Archive for the ‘capistrano’ Category

viennastreetstyle.com

Tuesday, May 27th, 2008

ViennaStreetStyle

Some days ago my first Rails application went live:

ViennaStreetstyle.com - ViennaStreetStyle is a simple photo gallery showing people on the streets of Vienna, Austria presenting their own style of street fashion.

I developed this application for friends of mine who had the idea for ViennaStreetstyle.com.

Development was quite straight-forward without any kind of a big suprise by using the following plugins/libraries:

  • attachment_fu
    For uploading and handling the images
  • geokit
    for locating the shots on the map of Vienna
  • YM4R
    Greatest plugin for doing all the GoogleMaps stuff
  • prototip
    Javascript library for easy rendering of complex tooltips

The whole system is running on a busy 256 MB VPS under Mongrel with 2 server instances (so in best condition to get slashdotted or sth like that).
But it is somehow an experiment for me how far you can go with that low server specs.

Phusion Passenger (a.k.a. mod_rails)

Friday, April 11th, 2008

As it seems a new star is born on the “Rails-How to-host” sky!
Phusion Passenger

After reading some posts, it seems to be a first rock-solid “mod_rails” implementation.
No Mongrel, no FCGI just a clever Apache module that hosts Rails directly out of your WebServer.

Just point your DocumentRoot to your public folder and there you go. Even restarting your application is damn easy:

touch /webapps/mycook/tmp/restart.txt

Even I can write a Capistrano recipe to do that!

And this statement is just the Killer for me:

Page caching is fully supported, without the need to configure mod_rewrite.

Unfortunately, I won’t be able to install it for the next 3 weeks, but I am looking forward to get this baby under test.

Save files, folders over Capistrano deploys

Sunday, March 2nd, 2008

If you use start using Capistrano and you get it working [ok, I have a server running Debian SARGE and I first had to manually compile eg. subversion to be compliant w/ the actual Capistrano version] you will really love it.

But then I had a situation:
I use attachment_fu as to upload images.
The Rails way - they are stored under ‘public/#{model_name}’.
Ok, but after every cap:deploy these will be deleted. Or more precise, the ‘current’ application version is linked to a blank folder as checked out from SVN. These files will not be available for the ‘current’ release anymore!

Hey but why don’t store these files in the ’shared’ folder and symlink to this folder every time. This folder is meant to be used for just that!

Actually this recipe is from the RailsMachine guys (they know how to handle Rails stuff)

Paste this in your deploy.rb:

set :symlinked_public_dirs, %w( ** a list of your folders that should be saved ** )

# this will create the shared folder at 'cap deploy:setup'
task :after_setup, :roles => [:app, :web] do
symlinked_public_dirs.each { |dir| run “mkdir -p #{shared_path}/public/#{dir}” }
end

#this will create the symlink after 'cap deploy'
task :after_symlink, :roles => [:app, :web] do
symlinked_public_dirs.each { |dir| run “ln -nfs #{shared_path}/public/#{dir} #{current_path}/public/#{dir}” }
end