简体   繁体   English

无法让Phusion Passenger使用Mac OS X Mountain Lion和Apache

[英]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. 我刚刚购买了安装了Lion Server的新Mac mini,并立即升级到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). 然后我继续安装rvm,rails,Passenger等,就像我一直做的那样(好吧,我最后一次安装Passenger我在Snow Leopard上)。

I followed the instructions found here: http://jasoncodes.com/posts/mac-os-rails-server#ruby 我按照这里的说明操作: 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. 启动/重新启动Apache时没有错误,但Passenger模块似乎根本没有加载。

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. Mountain Lion apache的信息非常稀疏,但它看起来像是一堆配置文件已从/ etc / apache2 /移到/ Library / Server / Web / Config / apache2,但我无法弄清楚我是什么需要改变才能有乘客负荷。

I faced the same problem while trying to install Redmine on Mountain Lion Server. 尝试在Mountain Lion Server上安装Redmine时遇到了同样的问题。

The solution was quite simple in my case: 在我的情况下,解决方案非常简单:

  1. install Xcode from the AppStore 从AppStore安装Xcode
  2. open Terminal 打开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 : passenger_module安装程序吐出的行粘贴到/private/etc/apache2/httpd.conf

    LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-3.0.18/ext/apache2/mod_passenger.so 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 PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-3.0.18

    PassengerRuby /System/Library/Frameworks/Ruby.framework/Version/1.8/usr/bin/ruby 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) (确保您的安装版本号正确 - 我的版本号为3.0.18)

The point is that in Mountain Lion Server the Server.app has it's httpd config files in 关键是在Mountain Lion Server中,Server.app拥有它的httpd配置文件

/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 但是,您无法识别对此文件所做的更改,要使它们永久化,您必须编辑/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. 如果您想使用乘客首选项窗格,则必须对其进行编译,因为预编译版本与Mountain Lion不兼容。

I used the instructions from redmine.org : 我使用了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 ) (如果你找不到xcodebuild ,它可能在/usr/bin/xcodebuild

Install the preference pane. 安装首选项窗格。 Look in ~/Downloads/passengerpane/build/Release , and double-click on P assenger.prefPane to install it. 查看~/Downloads/passengerpane/build/Release ,然后双击P assenger.prefPane进行安装。

Hope this helps.. 希望这可以帮助..

Cheers! 干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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