【问题标题】:Is Passenger Deprecated for Nginx versions above 1.14?对于 1.14 以上的 Nginx 版本,Passenger 是否已弃用?
【发布时间】:2021-09-01 18:11:36
【问题描述】:

我在 Ubuntu 18.04 上将 nginx 从版本 1.14 更新为 1.18 (Ubuntu)

这样做似乎会破坏乘客。所以我卸载并尝试通过Passenger installation Ubuntu 18.04 instructions重新安装开源乘客版本。

我到了这一行:

sudo apt-get install -y libnginx-mod-http-passenger

哪个会抛出这个错误

libnginx-mod-http-passenger : 取决于:nginx-common (

更新我也尝试使用企业版。按照企业版安装说明,我收到了类似的错误消息:

libnginx-mod-http-passenger-enterprise:取决于:nginx-common (

我确实尝试研究过这个问题,发现this issue on Phusion's GitHubthis more recent issue。看来大多数人正在做的是将他们的 nginx 版本回滚到1.14

【问题讨论】:

    标签: nginx passenger passenger-nginx


    【解决方案1】:

    它没有被弃用,不。问题是您尝试安装的打包模块是为通过系统默认存储库分发的旧 Nginx 版本制作的。这出现在您提到的installation guide 中:

    此时,我们假设您已经从 系统 存储库安装了 Nginx。

    这意味着以下说明假设您安装了 Nginx 特定版本(在您的情况下为1.14.0),并为此构建了打包模块。 new passenger documentation 中强调了这一点:

    如果你想使用我们打包的 Nginx 模块,你必须使用你的发行版提供的 Nginx 包。例如,如果您有 NGINX 设置提供的 repo,则需要compile a dynamic module compatible with that Nginx

    最后引用中的链接将带您了解如何编译动态乘客模块并在 Nginx 配置中启用它的指南。我不会重复整个过程以保持答案简短,但一般方法是这样的:

    1. 获取 Nginx 源代码的乘客模块。
    2. 获取已安装版本的 Nginx 源代码。
    3. 使用乘客模块编译 Nginx:
    cd /path-to-nginx-source-dir
    ./configure --prefix=/opt/nginx \
      --with-some-configure-flag \
      --add-dynamic-module=$(passenger-config --nginx-addon-dir) \
      --add-module=/path-to-some-other-nginx-module
    make
    sudo make install
    
    1. 将此行添加到nginx.conf,使 Nginx 加载模块:
    load_module modules/ngx_http_passenger_module.so;
    

    就个人而言,我宁愿选择“nginx-behind-nginx”方法,也不愿构建模块。那就是你有 Nginx 任何你喜欢的版本,但它作为另一个 Nginx 的反向代理运行,启用了乘客(Passenger Standalone)。由于对性能的影响不明显,这将更容易维护(安装、更新)。有关详细信息,请参阅此guide

    【讨论】:

    • 感谢您的回答!如果我理解正确:听起来我需要从源代码编译?含义:我需要同时获取 nginx 和乘客的源,做一些魔术将乘客与 nginx 捆绑,以便 nginx 源知道乘客,然后编译,或make 将带有乘客的 nginx 构建为二进制文件。对吗?
    • @Neil,是的,这是正确的。这对我来说不方便,这就是我添加最后一段的原因。
    • 这种方法当然不方便。我喜欢你的方法。再次非常感谢!
    • 乐于助人:)
    猜你喜欢
    • 2016-07-22
    • 2021-11-15
    • 1970-01-01
    • 1970-01-01
    • 2022-01-14
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    • 2018-09-12
    相关资源
    最近更新 更多