I'd first try installing passenger into the global gemset:
rvm use ree@global --default --passenger
rvm ree@global gem install passenger --version="${PASSENGER_VERSION}"
passenger-install-apache2-module --auto --apxs2-path $(which apxs2)
passenger-install-apache2-module --snippet >> /etc/apache2/conf.d/passenger.conf
Depending on your file permissions, you may or may not need to add the PassengerGroup www-data
directive.
Next, create your app gemsets:
rvm use ree@gemsetA --create
rvm ree@gemsetA gem install ${appA_gems}
rvm use ree@gemsetB --create
rvm ree@gemsetA gem install ${appB_gems}
# Must use .rvmrc files to change gemset per app
echo "rvm use ree@gemsetA" >> /path/to/appA/.rvmrc
echo "rvm use ree@gemsetB" >> /path/to/appB/.rvmrc
Finally, configure apache so each app gets it's own VirtualHost. Use a similar set of directives within the VirtualHost block:
RackBaseURI /path/to/app(A|B)
<Directory /path/to/app(A|B)>
PassengerAppRoot /path/to/app(A|B)
Options -MultiViews
AllowOverride all
Allow from all
</Directory>
You may need to play around with the paths for RackBaseURI
and PassengerAppRoot
depending on where you've installed your app, whether it's Rack based or otherwise, or how you've configured Apache. If in doubt, consult the Passenger Documentation.
If you've already tried this, and couldn't get it to work, and one of the apps cannot find it's gems... you may need to look into running Passenger Standalone.