Apache passenger stopped work after upgrade passenger from 5.1.12 to 5.20

时间:2018-02-05 13:01:13

标签: apache passenger redmine

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

2 个答案:

答案 0 :(得分:2)

来自5.2.0 Breaking change overview

  

我们删除了PassengerResolveSymlinksInDocumentRoot。这是一个古老的   Passenger版本2的兼容性选项。切换到   如果您通过a设置应用程序root,请PassengerAppRoot   包含符号链接的文档根目录。

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

答案 1 :(得分:0)

我通过降级乘客版本解决了这个问题。

1)卸载新版本:

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

2)安装特定版本:

sudo apt-get install passenger=1:5.1.12-1~trusty1
sudo apt-get install libapache2-mod-passenger=1:5.1.12-1~trusty1
sudo apt-get install passenger-dev=1:5.1.12-1~trusty1

3)Enaple apache模块:

sudo a2enmod passenger

4)重启apache:

sudo service apache2 restart

5)享受