简体   繁体   中英

Phusion passenger and running multiple ruby version with apache

I have two different rails websites buid on ruby 1.8.x and ruby 1.9.11 respectively. I already have configured my /etc/httpd/conf/http.conf with the following lines of code:

LoadModule passenger_module /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/passenger-3.0.18/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/passenger-3.0.18
PassengerRuby /opt/ruby-enterprise-1.8.7-2012.02/bin/ruby

as suggested by
passenger-install-apache2-module

likewise I have also added the further necessary code replacing the substitutes :

 <VirtualHost *:80> ServerName www.example.com # !!! Be sure to point DocumentRoot to 'public'! DocumentRoot /somewhere/public <Directory /somewhere/public> # This relaxes Apache security settings. AllowOverride all # MultiViews must be turned off. Options -MultiViews </Directory> </VirtualHost> 

All works fine, till now but when I try to add another configuration for ruby 1.9.3 app, and follow the above same process, then I am not able to run both ruby 1.8.7 app and 1.9.3 app simultaneously.The latter runs successfully where as the former generates error.

I am using rvm to manage both apps, and have seperate gemsets for each of the application.

So, my question is that, how can I run both my applications simultaneously.

Passenger 4 allows PassengerRuby to be set per application.

The final release is just around the corner but in the mean time you can install it via gem install passenger --pre .

You can't run multiple ruby version simultaneously within a single phussion passenger configuration. If this is the case then one should run with the standalone server (let's say on port 4000) and the you should configure apache to run as a proxy on that port. See http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/ for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM