在 Ubuntu 13.10 上安装 Phusion Passenger 4.0.20

在 Ubuntu 13.10 上安装 Phusion Passenger 4.0.20

因此,我尝试在最新版本的 KUbuntu (13.10) 上安装 Passenger。我使用apache2-mpm-workerMuon 包管理器的包安装了 Apache2。这些是我运行的命令。

rvmsudo gem install passenger
rvmsudo passenger-install-apache2-module

但我一直收到以下错误:

[Fri Oct 18 15:52:13.227790 2013] [core:warn] [pid 13095] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined                        
[Fri Oct 18 15:52:13.227933 2013] [core:warn] [pid 13095] AH00111: Config variable ${APACHE_PID_FILE} is not defined                        
[Fri Oct 18 15:52:13.227969 2013] [core:warn] [pid 13095] AH00111: Config variable ${APACHE_RUN_USER} is not defined                        
[Fri Oct 18 15:52:13.227991 2013] [core:warn] [pid 13095] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined                       
[Fri Oct 18 15:52:13.228026 2013] [core:warn] [pid 13095] AH00111: Config variable ${APACHE_LOG_DIR} is not defined                         
[Fri Oct 18 15:52:13.231737 2013] [core:warn] [pid 13095:tid 3074562624] AH00111: Config variable ${APACHE_RUN_DIR} is not defined          
[Fri Oct 18 15:52:13.232760 2013] [core:warn] [pid 13095:tid 3074562624] AH00111: Config variable ${APACHE_LOG_DIR} is not defined          
[Fri Oct 18 15:52:13.233043 2013] [core:warn] [pid 13095:tid 3074562624] AH00111: Config variable ${APACHE_LOG_DIR} is not defined          
[Fri Oct 18 15:52:13.233078 2013] [core:warn] [pid 13095:tid 3074562624] AH00111: Config variable ${APACHE_LOG_DIR} is not defined          
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:                                                                              
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}                                                                                 

--------------------------------------------                                                                                                

WARNING: Apache doesn't seem to be compiled with the 'prefork', 'worker' or 'event' MPM

Phusion Passenger has only been tested on Apache with the 'prefork', the                                                                    
'worker' and the 'event' MPM. Your Apache installation is compiled with                                                                     
the '' MPM. We recommend you to abort this installer and to recompile                                                                       
Apache with either the 'prefork', the 'worker' or the 'event' MPM.                                                                          

Press Ctrl-C to abort this installer (recommended).
Press Enter if you want to continue with installation anyway.

我的运行结果apache2ctl -V是:

Server version: Apache/2.4.6 (Ubuntu)
Server built:   Aug  9 2013 14:31:04
Server's Module Magic Number: 20120211:23
Server loaded:  APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture:   32-bit
Server MPM:     worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

可以看出,服务器使用 worker MPM 编译,那么为什么乘客会抱怨?我该如何解决上述错误(实际上是警告,但为了安全起见,我希望没有任何警告)?

谢谢。

答案1

这是由于缺少一些环境变量造成的。请先尝试运行此命令:

$ rvmsudo $SHELL
# source /etc/apache2/envvars
# export HOME=/home/USRNAME

该脚本设置缺失的变量(相应地更改 USRNAME)。

答案2

我看到你已经解决了这个问题,但对于其他人来说......Passenger 现在为最后的 ubuntu 发行版提供了预编译的二进制文件,因此无需passenger-install-apache2-module在每次升级时进行预编译。

我按照这个说明操作并且它对我有用:http://www.modrails.com/documentation/Users%20guide%20Apache.html#install_on_debian_ubuntu

相关内容