如何判断 Apache 可能已损坏并阻止 ruby​​ 乘客模块安装

如何判断 Apache 可能已损坏并阻止 ruby​​ 乘客模块安装

我正在将 ruby​​ on rails 应用程序安装到 Ubuntu 14.04 服务器上。作为安装的一部分,我需要为 Apache 安装 Passenger 模块。当我运行“passenger-install-apache2-module”时,我收到一条消息“您的 Apache 安装可能已损坏”。它给出了一些建议的命令,但它们没有显示任何有用的信息。完整输出如下。

Ruby、rails、Apache 和 RVM 都已安装。我之前已经尝试过删除并重新安装它们,但没有成功。

我需要做什么特别的事情才能查看 Apache 或 Passenger 到底出了什么问题?我想避免再次重新安装 Apache 或 Ruby。

提前致谢!

乘客脚本后的精确输出表明所有依赖关系均已满足。

Sanity checking Apache installation...
AH00526: Syntax error on line 10 of /etc/apache2/pf.conf:
Invalid command 'RailsEnv', perhaps misspelled or defined by a module not included in     the server configuration
AH00526: Syntax error on line 10 of /etc/apache2/pf.conf:
Invalid command 'RailsEnv', perhaps misspelled or defined by a module not included in  the server configuration
Your Apache installation might be broken

You are about to install Phusion Passenger against the following
Apache installation:

apxs2: /usr/bin/apxs2

However, this Apache installation appears to be broken, so this installer
cannot continue. To find out why this installer thinks the above Apache
installation is broken, run:

export ORIG_PATH="$PATH"
rvmsudo -E /bin/bash
export PATH="$ORIG_PATH"
/home/azureuser/.rvm/gems/ruby-2.1.2/wrappers/ruby /home/azureuser/.rvm/gems/ruby-   2.1.2/gems/passenger-4.0.48/bin/passenger-config --detect-apache2

It is also possible that your system has multiple Apache installations,
and that you are simply compiling Phusion Passenger against the wrong
Apache install. If this is the case, then the above command will also
advise you about what to do.

编辑:运行底部列出的命令后,会有更多详细信息。正确吗?因为我使用的是 apache2,所以/usr/bin/apxs不应该这样吗?apxs2

运行它给出的命令只会产生与上面相同的输出。

Detecting configuration file location...
AH00526: Syntax error on line 10 of /etc/apache2/pf.conf:
Invalid command 'RailsEnv', perhaps misspelled or defined by a module not included in the server configuration
AH00526: Syntax error on line 10 of /etc/apache2/pf.conf:
Invalid command 'RailsEnv', perhaps misspelled or defined by a module not included in   the server configuration
 --> Cannot detect default config file location!
Cannot find a usable Apache installation using /usr/bin/apxs.

Final autodetection results
Sorry, this program cannot find an Apache installation.

To install Apache, please run the following. It will tell you how to install Apache.

/home/azureuser/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.48/bin/passenger-install-apache2-module

If you are sure that you have Apache installed, please read the documentation:
https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#forcing_location_of_command_line_tools_and_dependencies

答案1

您的 Apache 配置破碎的。

具体来说,您有一个文件/etc/apache2/pf.conf正在尝试使用 Phusion Passenger 提供的指令,但您尚未安装它!

将此文件暂时移至其他位置,然后运行安装。安装完成后,如有必要,您可以将其移回。

相关内容