Apache-2.2

如何判斷 Apache 可能如何被破壞並阻止 ruby 乘客模組安裝

  • June 27, 2016

我正在將 ruby​​ on rails 應用程序安裝到 Ubuntu 14.04 伺服器。作為其中的一部分,我需要為 Apache 安裝乘客模組。當我執行“passenger-install-apache2-module”時,我收到一條消息“您的 Apache 安裝可能已損壞”。它提供了一些建議的命令,但它們沒有透露任何有用的資訊。完整的輸出如下。

Ruby、rails、Apache 和 RVM 都已安裝。我之前已經嘗試過刪除並重新安裝所有這些,但沒有成功。

我有什麼特別需要做的,以查看 Apache 或乘客究竟可能會破壞什麼?我想避免再次重新安裝 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.

編輯:執行底部列出的命令後的更多詳細資訊。是/usr/bin/apxs正確的嗎?不應該是apxs2因為我使用的是apache2嗎?

執行它給出的命令只會產生與上面相同的輸出。

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

您的 Apache 配置損壞。

具體來說,您有一個文件/etc/apache2/pf.conf正在嘗試使用您尚未安裝的 Phusion Passenger 提供的指令!

將此文件暫時移至其他位置,然後執行安裝。安裝完成後,如有必要,您可以將其移回。

引用自:https://serverfault.com/questions/616990