DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Configuración De Apache Para Passenger 2.2.9 (usado Con Redmine)

02.02.2010
| 3472 views |
  • submit to reddit
        Fichero: /etc/apache2/conf.d/passenger

Se usa para indicar a Apache las rutas de ejecutables de Passenger 2.2.9
e incluir los módulos en la carga.

Se añaden opciones como "RailsSpawnMethod smart" para optimizar el funcionamiento.
En ciertos ambientes pueden ser contraproducentes: googlead.


# http://adminsq3.blogspot.com

# Usando Ruby Enterprise
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.9/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.9
PassengerRuby /usr/local/bin/ruby
PassengerDefaultUser www-data

# Usando Ruby
#LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.9/ext/apache2/mod_passenger.so
#PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.9
#PassengerRuby /usr/bin/ruby1.8
#PassengerDefaultUser www-data

# Speeds up spawn time tremendously -- if your app is compatible. 
# RMagick seems to be incompatible with smart spawning
RailsSpawnMethod smart

# Just in case you're leaking memory, restart a listener 
# after processing 5000 requests
PassengerMaxRequests 5000

# only check for restart.txt et al up to once every 5 seconds, 
# instead of once per processed request
PassengerStatThrottleRate 60

# Keep the spawners alive, which speeds up spawning a new Application
# listener after a period of inactivity at the expense of memory.
RailsAppSpawnerIdleTime 0

# Additionally keep a copy of the Rails framework in memory. If you're 
# using multiple apps on the same version of Rails, this will speed up
# the creation of new RailsAppSpawners. This isn't necessary if you're
# only running one or 2 applications, or if your applications use
# different versions of Rails.
RailsFrameworkSpawnerIdleTime 0

# Keep the application instances alive longer. Default is 300 (seconds)
PassengerPoolIdleTime 600