gpt4 book ai didi

ruby-on-rails - 升级 Phusion Passenger 无需重新安装 Nginx

转载 作者:行者123 更新时间:2023-12-04 04:59:47 25 4
gpt4 key购买 nike

是否可以在 Phusion Passenger 已经运行时将其升级到较新的版本(在我的情况下使用 Nginx)?

我使用 passenger-install-nginx-module 安装了 Passenger 4.0.0.rc6 .我的 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。 (我认为在我使用 --prefix 指定的位置已经安装了 Nginx 会很聪明)

我试图手动更改 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从旧的 gem ,因为有些东西可能已经改变了。

那么......在不重新编译和重新安装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的正确方法是
  • 安装新的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
  • 利润
  • 关于ruby-on-rails - 升级 Phusion Passenger 无需重新安装 Nginx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16507489/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com