简体   繁体   中英

Can't get Phusion Passenger working with Mac OS X Mountain Lion and Apache

I just purchased a new Mac mini with Lion Server installed, and immediately upgraded to Mountain Lion Server. I then proceeded to install rvm, rails, Passenger, etc as I've always done (well, the last time I had to install Passenger I was on Snow Leopard).

I followed the instructions found here: http://jasoncodes.com/posts/mac-os-rails-server#ruby

I get no errors when starting/restarting Apache, but the Passenger module doesn't seem to get loaded at all.

Info for Mountain Lion apache is pretty sparse out there, but it looks like a bunch of config files have been moved from /etc/apache2/ into /Library/Server/Web/Config/apache2, but I can't figure out what I need to change to have Passenger load.

I faced the same problem while trying to install Redmine on Mountain Lion Server.

The solution was quite simple in my case:

  1. install Xcode from the AppStore
  2. open Terminal
  3. sudo gem install passenger
  4. sudo passenger-install-apache2-module
  5. sudo nano /private/etc/apache2/httpd.conf
  6. paste the lines the passenger_module installer spits out into /private/etc/apache2/httpd.conf :

    LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-3.0.18/ext/apache2/mod_passenger.so

    PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-3.0.18

    PassengerRuby /System/Library/Frameworks/Ruby.framework/Version/1.8/usr/bin/ruby

(Make sure you have the correct version number from your installation - mine is 3.0.18)

The point is that in Mountain Lion Server the Server.app has it's httpd config files in

/Library/Server/Web/Config/apache2/httpd_server_app.conf

However the changes you make to this file are not recognized, to make them permanent you have to edit /private/etc/apache2/httpd.conf

If you want to use the Passenger Preference Pane you'll have to compile it, as the precompiled version is not compatible with Mountain Lion.

I used the instructions from redmine.org :

cd ~/Downloads

git clone https://github.com/Fingertips/passengerpane/

cd passengerpane

xcodebuild

(If you can't find xcodebuild , it may be in /usr/bin/xcodebuild )

Install the preference pane. Look in ~/Downloads/passengerpane/build/Release , and double-click on P assenger.prefPane to install it.

Hope this helps..

Cheers!

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