我有两个不同的Rails应用程序。
一个使用Ruby 1.9.3,另一个使用2.0。我需要在同一个Apache2服务器上托管这两个应用程序。
我试过这样的事情:
Listen 81
Listen 82
LoadModule passenger_module /home/admin1/.rvm/gems/ruby-1.9.3-p194/gems/passenger-4.0.53/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/admin1/.rvm/gems/ruby-1.9.3-p194/gems/passenger-4.0.53
PassengerRuby /home/admin1/.rvm/gems/ruby-1.9.3-p194/wrappers/ruby
</IfModule>
<VirtualHost *:81>
ServerName test.ap_live_streaming.com
RailsEnv test
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /home/admin1/app/current/ap_live_streaming/public
<Directory /home/admin1/app/current/ap_live_streaming/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
Require all granted
</Directory>
</VirtualHost>
LoadModule passenger_module /home/admin1/.rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.53/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/admin1/.rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.53
PassengerDefaultRuby /home/admin1/.rvm/gems/ruby-2.0.0-p451/wrappers/ruby
</IfModule>
<VirtualHost *:82>
ServerName test.ap_live_streaming.com
RailsEnv test
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /home/admin1/app/current/do_dashboard/public
<Directory /home/admin1/app/current/do_dashboard/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
Require all granted
</Directory>
</VirtualHost>
但是,在重启Apache2服务器时,它显示:
[Mon Nov 03 14:59:02.547078 2014] [so:warn] [pid 15821] AH01574: module passenger_module is already loaded, skipping
虚拟主机没有问题。但我对loadmodules一点担心。