将Apache乘客从5.1.12升级到5.20后,Apache乘客停止工作 [英] Apache passenger stopped work after upgrade passenger from 5.1.12 to 5.20

查看:121
本文介绍了将Apache乘客从5.1.12升级到5.20后,Apache乘客停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将Apache乘客模块从5.1.12升级到5.2.0后,Apache无法正常启动并出现错误

# apache2ctl configtest
Invalid command 'PassengerResolveSymlinksInDocumentRoot', perhaps misspelled or defined by a module not included in the server configuration

在Apache虚拟主机中的注释字符串之后

# PassengerResolveSymlinksInDocumentRoot on

Apache启动,但Redmine无法正常显示插入主页的目录目录/文件(换句话说,找不到索引文件)

操作系统:Ubuntu 14.04.5 LTS

# dpkg -l | grep passenger
ii  libapache2-mod-passenger           1:5.2.0-1~trusty1                                        
ii  passenger                          1:5.2.0-1~trusty1                                        
ii  passenger-dev                      1:5.2.0-1~trusty1                                        
ii  passenger-doc                      1:5.2.0-1~trusty1

所有数据包都是从oss-binaries.phusionpassenger.com安装的

# cat /etc/apt/sources.list.d/passenger.list
deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main

模块乘客已启用

# a2query -m | grep pass
passenger (enabled by site administrator)                                        

我尝试重新安装乘客(删除并重新安装)

# apt-get remove -y passenger libapache2-mod-passenger
# apt-get install -y libapache2-mod-passenger

但是,它并没有帮助解决问题

# passenger-config validate-install
What would you like to validate?
Use <space> to select.
If the menu doesn't display correctly, press '!'

 ‣ ⬢  Passenger itself
  ⬡  Apache

-------------------------------------------------------------------------
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... ✓

# passenger-config validate-install
What would you like to validate?
Use <space> to select.
If the menu doesn't display correctly, press '!'

⬢  Passenger itself
 ‣ ⬡  Apache

-------------------------------------------------------------------------
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... ✓

乘客身份

# passenger-status
Version : 5.2.0
Date    : 2018-02-05 12:23:58 +0100
Instance: homhYxzl (Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.2.0)

----------- General information -----------
Max pool size : 6
App groups    : 0
Processes     : 0
Requests in top-level queue : 0

# passenger-install-apache2-module
The Phusion Passenger Apache module is correctly installed :-)

P.S.我设法解决了这个问题

PassengerResolveSymlinksInDocumentRoot

根据5.p版本,此选项已被删除

https://blog.phusion.nl/2018/01/29/passenger-5-2-0/

所以有2种解决方法

1.不要在DocumentRoot中使用符号链接

2.在虚拟主机Apache中使用参数PassengerAppRoot(如果在DocumentRoot中使用符号链接)

<VirtualHost *:443>
    ServerName myservername
    DocumentRoot /var/www/redmine
    PassengerAppRoot /opt/redmine/redmine
…
</VirtualHost>

# ls -l /var/www/redmine
lrwxrwxrwx 1 root root 27 Apr 27  2017 /var/www/redmine -> /opt/redmine/redmine/public

解决方案

来自 5.2.0重大更改概述:

我们已删除PassengerResolveSymlinksInDocumentRoot.那是旧的 乘客版本2的兼容性选项.切换到 PassengerAppRoot (如果您通过 包含符号链接的文档根目录.

使用 PassengerAppRoot 指定应用程序的根目录

After upgrade Apache module Passenger from 5.1.12 to 5.2.0 Apache doesn't start properly and exit with the error

# apache2ctl configtest
Invalid command 'PassengerResolveSymlinksInDocumentRoot', perhaps misspelled or defined by a module not included in the server configuration

After comment string in Apache virtual host

# PassengerResolveSymlinksInDocumentRoot on

Apache starts but Redmine doesn't work showing listing directoty/files insted of main page(another words can't find index file)

OS: Ubuntu 14.04.5 LTS

# dpkg -l | grep passenger
ii  libapache2-mod-passenger           1:5.2.0-1~trusty1                                        
ii  passenger                          1:5.2.0-1~trusty1                                        
ii  passenger-dev                      1:5.2.0-1~trusty1                                        
ii  passenger-doc                      1:5.2.0-1~trusty1

All packets is installed from oss-binaries.phusionpassenger.com

# cat /etc/apt/sources.list.d/passenger.list
deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main

Module passenger is enable

# a2query -m | grep pass
passenger (enabled by site administrator)                                        

I have tried reinstall passenger(delete and install again)

# apt-get remove -y passenger libapache2-mod-passenger
# apt-get install -y libapache2-mod-passenger

However it hasn't helped to resove the issue

# passenger-config validate-install
What would you like to validate?
Use <space> to select.
If the menu doesn't display correctly, press '!'

 ‣ ⬢  Passenger itself
  ⬡  Apache

-------------------------------------------------------------------------
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... ✓

# passenger-config validate-install
What would you like to validate?
Use <space> to select.
If the menu doesn't display correctly, press '!'

⬢  Passenger itself
 ‣ ⬡  Apache

-------------------------------------------------------------------------
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... ✓

Passenger status

# passenger-status
Version : 5.2.0
Date    : 2018-02-05 12:23:58 +0100
Instance: homhYxzl (Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.2.0)

----------- General information -----------
Max pool size : 6
App groups    : 0
Processes     : 0
Requests in top-level queue : 0

# passenger-install-apache2-module
The Phusion Passenger Apache module is correctly installed :-)

P.S. I have managed to resolve the issue

PassengerResolveSymlinksInDocumentRoot

This option has been removed in 5.2.0 version according to

https://blog.phusion.nl/2018/01/29/passenger-5-2-0/

So there are 2 ways to fix it

1.Don't use symbol links in DocumentRoot

2.Use parameter PassengerAppRoot in virtual host Apache(if you use symbol link in DocumentRoot)

<VirtualHost *:443>
    ServerName myservername
    DocumentRoot /var/www/redmine
    PassengerAppRoot /opt/redmine/redmine
…
</VirtualHost>

# ls -l /var/www/redmine
lrwxrwxrwx 1 root root 27 Apr 27  2017 /var/www/redmine -> /opt/redmine/redmine/public

解决方案

From 5.2.0 Breaking change overview:

We've removed PassengerResolveSymlinksInDocumentRoot. It was an old compatibility option for Passenger version 2. Switch to PassengerAppRoot if you are setting the application root via a document root containing symlinks.

Use PassengerAppRoot to specify your application's root directory

这篇关于将Apache乘客从5.1.12升级到5.20后,Apache乘客停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆