I'm trying to perform a fresh install of Ruby on Rails running with Apache2/Passenger on Ubuntu. I was able to successfully install apache2, rvm, ruby, rails and passenger, the latter part following this tutorial. All the installations went smoothly; I end up with these versions of software:
- Ubuntu 11.10 running on Amazon EC2
- Apache 2.2.20
- RVM 1.10.2
- Ruby 1.9.3p0
- Rails 3.1.3
- Passenger 3.0.11
After running passenger-install-apache2-module
the installer recommended me to:
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p0/ruby
When wiring up Apache2 to use mod_passenger, this is where I run into trouble.
I go to /etc/apache2/mods-available
and edit:
passenger.load
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so`
to
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/ext/apache2/mod_passenger.so`
passenger.conf
<IfModule mod_passenger.c>
PassengerRoot /usr
PassengerRuby /usr/bin/ruby
</IfModule>
to
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p0/ruby
</IfModule>
Then I restart the server via apachectl restart
. When I load the site, I'm greeted with an HTTP error, as viewed from Google Chrome:
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.
And when I check the Apache /var/log/apache2/error.log , I find this:
[Thu Jan 19 19:32:07 2012] [notice] Apache/2.2.20 (Ubuntu) Phusion_Passenger/3.0.11 configured -- resuming normal operations
[Thu Jan 19 19:32:09 2012] [notice] child pid 4163 exit signal Segmentation fault (11)`
So it would appear the mod isn't loading or running properly; how do I fix this?
Edit: Extra info
My virtual host:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /somewhere/public
ServerName mydomain.com
ServerAlias *.mydomain.com
RackBaseURI /
RackEnv production
PassengerMaxPoolSize 4
<Directory "/somewhere/public">
Options Indexes FollowSymLinks -MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>