是否有可能在Phusion Passenger运行时将其升级到更新的版本(在我的情况下使用Nginx)?
我使用安装了Passenger 4.0.0.rc6 passenger-install-nginx-module
.我的Nginx配置现在包含
passenger_root /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.rc6; passenger_ruby /usr/local/bin/ruby;
现在我想升级到Passenger 4.0.2.我可以安装gem,但是当我passenger-install-nginx-module
再次运行时,它会尝试重新编译并重新安装Nginx.(我认为在我指定的位置已经安装了Nginx会非常聪明--prefix
)
我尝试手动更改passenger_root
为新的Passenger gem位置但是我在Nginx错误日志中收到以下错误:
2013/05/12 12:30:13 [alert] 14298#0: Unable to start the Phusion Passenger watchdog because its executable (/usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.2/agents/PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete, or that your 'passenger_root' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'passenger_root' directive, whichever is applicable. (-1: Unknown error)
显然PassengerWatchdog
是在运行时构建的passenger-install-nginx-module
.我不想复制PassengerWatchdog
旧宝石,因为有些东西可能已经改变了.
那么......在没有重新编译和重新安装Nginx(或Apache)的情况下升级Passenger的正确方法是什么?
@ Wukerplank的评论让我走上正轨.我passenger-install-nginx-module
再次运行时检查了输出,它说:
Nginx doesn't support loadable modules such as some other web servers do, so in order to install Nginx with Passenger support, it must be recompiled. Do you want this installer to download, compile and install Nginx for you? 1. Yes: download, compile and install Nginx for me. (recommended) The easiest way to get started. A stock Nginx 1.4.1 with Passenger support, but with no other additional third party modules, will be installed for you to a directory of your choice. 2. No: I want to customize my Nginx installation. (for advanced users) Choose this if you want to compile Nginx with more third party modules besides Passenger, or if you need to pass additional options to Nginx's 'configure' script. This installer will 1) ask you for the location of the Nginx source code, 2) run the 'configure' script according to your instructions, and 3) run 'make install'. Whichever you choose, if you already have an existing Nginx configuration file, then it will be preserved.
重要的是,必须重新编译Nginx以与Passenger一起使用,并保留现有的Nginx配置.
因此升级乘客的正确方法是
安装新的Passenger gem
passenger-install-nginx-module
使用与第一次完全相同的参数执行(因此编译相同的Nginx版本和模块,它安装在同一目录中等)
在安装之前,检查它是否显示"欢迎使用Phusion Passenger Nginx模块安装程序,v4.0.2".最新版本(在我的情况下为4.0.2)
在安装Nginx之后passenger_root
,将现有的Nginx conf(path/to/nginx/conf/nginx.conf)更改为指向新的gem版本(只需用新版本替换旧版本号)
重启Nginx
利润
如果不重新编译Nginx,则无法升级.完整的升级说明可以在Phusion Passenger for Nginx手册中找到.从手册:
Nginx与其他Web服务器的不同之处在于它不支持可加载模块.扩展Nginx的唯一方法是完全从源代码重新编译它.由于Phusion Passenger由一些外部可执行文件和一个Nginx模块组成,因此您必须在首次安装Phusion Passenger时重新编译Nginx,还要在升级Nginx本身或升级Phusion Passenger版本时重新编译.
我们将在此步骤中重新编译Nginx和Phusion Passenger可执行文件.好消息是Phusion Passenger提供了一个工具,让您轻松实现这一目标.
如果您之前已经安装过Nginx,但没有Phusion Passenger支持,那么您应该先卸载它.您不必这样做,因为您还可以与现有的Nginx并行安装另一个具有Phusion Passenger支持的Nginx.我们只是建议卸载现有的以避免用户混淆,但选择权在您手中.
如果您之前已经安装了具有Phusion Passenger支持的Nginx,并且您正在升级,那么您不必先卸载现有的Nginx.相反,我们将在此步骤覆盖它.但是,使用上次使用的配置参数重新编译Nginx非常重要.