大网数据广告活动
服务器运维问答

Apache Passenger Resolve Symlinks stopped working | Invalid command

· 52CE 我爱测

I have a Ubuntu Server (16.04.3 LTS) with Apache 2.4.18 and redmine installed, following this installation guide . Therefor I edited the ssl.conf in my apache2/sites-available and added those lines: <IfModule mod_ssl.c> <VirtualH…

问题原文

原帖链接 · LKKP4ThX · CC BY-SA 3.0

I have a Ubuntu Server (16.04.3 LTS) with Apache 2.4.18 and redmine installed, following this installation guide.

Therefor I edited the ssl.conf in my apache2/sites-available and added those lines:

<IfModule mod_ssl.c>
  <VirtualHost _default_:443>
   ...

    <Directory /var/www/html/redmine>
      RailsBaseURI /redmine
      PassengerResolveSymlinksInDocumentRoot on
    </Directory>

  </VirtualHost>
</IfModule>

This used to be working for several months, but today I edited the ssl.conf to add another location. Now the Apache restart fails and systemctl status apache2.service shows the following error message:

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

Neither did I change anything in the redmine part of ssl.conf nor did I enable or disable any Apache modules.

Even reverting the changes doesn't help avoiding this error message.

Commenting PassengerResolveSymlinksInDocumentRoot makes Apache work again, but disables the redmine installation.

passenger-config validate-install returns zero errors if the line is commented, and 'Your Apache installation might be broken' if the line is uncommented.

Is there any way to fix this or are there any other files I should check to fix this error?

已采纳解答

原帖链接 · Евгений Каменев · CC BY-SA 3.0

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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-02-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。