* Passenger on Rails Playground
Posted on August 29th, 2009 by Dave Johnson. Filed under Uncategorized.
I finally setup Passenger (mod_rails) on my Rails Playground server the other day so that I can quit worrying about Mongrel and it is super easy. The main problem that I found was that I had a spelling mistake in my httpd.conf file in the PassengerRuby config line. The error that this produced in the Apache error_log file seemed to be referring to starting the spawn server.
Could not start the spawn server: /usr/local/lib/ruby: Permission denied (13)
So I spent a long time trying to find info about Passenger spawn server settings, but the problem in the end was that the path shown in the error did not exist - it should have been pointing to bin obviously :S
The other part of using passenger is the slightly different Capistrano recipe. With Passenger there is no spinner task and you need to put in an empty restart task. Here is my recipe:
########################
# Application
########################set :application, “example.com”
set :deploy_to, “/var/rails/#{application}”########################
# Settings
########################default_run_options[:pty] = true
ssh_options[:forward_agent] = false
set :runner, “user”########################
# Servers
########################set :user, “user”
set :domain, “example.com”
server domain, :app, :web
role :db, domain, :primary => true########################
# Subversion
########################set :repository, “http://svn.example.com/trunk/server”
set :scm_username, “user”
set :scm_password, “password”########################
# Passenger
########################namespace :passenger do
desc “Restart Application”
task :restart do
run “chown -R apache:apache #{current_path}”
run “touch #{current_path}/tmp/restart.txt”
end
endafter :deploy, “passenger:restart”
deploy.task :start do
# nothing
end
The other thing that I found I had to do was the chown call since Passenger runs the Rails app with the same user as is running Apache, in this case the apache user and apache group.
Now on to try out Cassandra.
Leave a Reply
Recent Posts
Archives
- March 2010
- February 2010
- January 2010
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
