#!/usr/bin/ruby $VIRTUAL_HOST=< ("localhost" => ("socket" => "/tmp/railsapp-%RAILS_APP%.socket", "min-procs" => 2, "max-procs" => 2, "bin-path" => "/var/www/lighttpd/rails/%RAILS_APP%/public/dispatch.fcgi", "bin-environment" => ("RAILS_ENV" => "production") ) ) ) } EOV Dir["/etc/lighttpd/railsapp-enabled/*"].each do |railsapp| puts $VIRTUAL_HOST.gsub(/%RAILS_APP%/, File.basename(railsapp)) end