无效的命令“ PassengerAppRoot”,可能是服务器配置中未包含的模块拼写错误或定义了该命令 [英] Invalid command 'PassengerAppRoot', perhaps misspelled or defined by a module not included in the server configuration
问题描述
我已经按照在Linux / Unix生产服务器
上为Node.js应用程序+ Red Hat 6 / CentOS 6(带有RPM)安装乘客+ Apache ,一切正常,但是当我尝试配置我的在我的centos 6服务器上使用WHM托管我的botkit bot的virtualhost子域中,出现此错误:
I have followed every step for installation given in Installing Passenger + Apache on a Linux/Unix production server for Node.js apps + Red Hat 6 / CentOS 6 (with RPM) and everything worked but when I am trying to configure my subdomain in virtualhost on my centos 6 server using WHM to host my botkit bot, I get this error :
/ usr / local / apache / bin / httpd命令(进程27088)在结束时报告
错误号1。在文件/usr/local/apache/conf/includes/post_virtualhost_2.conf.tmp的第9行
中检测到配置问题:
无效的命令 PassengerAppRoot,可能是
模块拼写错误或定义的不包含在服务器配置中---
/usr/local/apache/conf/includes/post_virtualhost_2.conf.tmp --- 3
ServerAlias subdomain.mydomain.com 4 ServerAdmin
adminserver @ mydomain.com 5 6 7#告诉Apache和乘客
应用程序的代码目录在哪里8 DocumentRoot / var / www / MyApp / Code / public 9
===> PassengerAppRoot / var / www / MyApp / Code< === 10#错误记录11 ErrorLog日志/ subdomain-error_log 12 CustomLog
日志/ subdomain-access_log common 13 14#告诉乘客您的应用程序
是Node.js应用程序15 PassengerAppType节点---
/usr/local/apache/conf/includes/post_virtualhost_2.conf.tmp ---
The "/usr/local/apache/bin/httpd" command (process 27088) reported error number 1 when it ended. Configuration problem detected on line 9 of file /usr/local/apache/conf/includes/post_virtualhost_2.conf.tmp: Invalid command 'PassengerAppRoot', perhaps misspelled or defined by a module not included in the server configuration --- /usr/local/apache/conf/includes/post_virtualhost_2.conf.tmp --- 3 ServerAlias subdomain.mydomain.com 4 ServerAdmin adminserver@mydomain.com 5 6 7 # Tell Apache and Passenger where your app's code directory is 8 DocumentRoot /var/www/MyApp/Code/public 9 ===> PassengerAppRoot /var/www/MyApp/Code <=== 10 #Error logging 11 ErrorLog logs/subdomain-error_log 12 CustomLog logs/subdomain-access_log common 13 14 # Tell Passenger that your app is a Node.js app 15 PassengerAppType node --- /usr/local/apache/conf/includes/post_virtualhost_2.conf.tmp ---
这是我的配置:
<VirtualHost *:80>
ServerName www.subdomain.mydomain.com
ServerAlias subdomain.mydomain.com
ServerAdmin adminserver@mydomain.com
# Tell Apache and Passenger where your app's code directory is
DocumentRoot /var/www/MyApp/code/public
PassengerAppRoot /var/www/MyApp/code
#Error logging
ErrorLog logs/votebot-error_log
CustomLog logs/votebot-access_log common
# Tell Passenger that your app is a Node.js app
PassengerAppType node
PassengerStartupFile bot.js
# Relax Apache security settings
<Directory /var/www/MyApp/code/public>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>
</VirtualHost>
我尝试删除配置并通过.htaccess进行传递:
I tried to remove the configuration and pass via .htaccess :
PassengerEnabled on
PassengerAppRoot /var/www/MyApp/code
SetEnv NODE_ENV production
SetEnv NODE_PATH /usr/lib/node_modules
PassengerAppType node
PassengerStartupFile bot.js
但仍然无法正常工作。
我最近检查了一下,并在验证乘客时得到以下消息:
But still it is not working. I checked lately and got the following message when validating passenger :
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... (!)
You are currently validating against Phusion Passenger 5.1.8, located in:
/usr/bin/passenger
Besides this Passenger installation, the following other
Passenger installations have also been detected:
/usr/local/rvm/gems/ruby-2.4.1/bin/passenger
Please uninstall these other Passenger installations to avoid
confusion or conflicts.
问题是我不知道卸载/ usr / local / rvm /的步骤是什么gems / ruby-2.4.1 / bin / passenger。
The problem is I don't know what are the steps to uninstall /usr/local/rvm/gems/ruby-2.4.1/bin/passenger .
推荐答案
该错误表示尚未加载乘客模块指定乘客配置选项之前,在apache配置中的 LoadModule passenger_module / path / to /.../ passenger / buildout / apache2 / mod_passenger.so
行。
That error means that the Passenger module hasn't been loaded with a LoadModule passenger_module /path/to/.../passenger/buildout/apache2/mod_passenger.so
line in your apache config before the Passenger config options are specified.
如果 sudo / usr / bin / passenger-config validate-install
通过了apache配置测试,则您有多个apache配置
If sudo /usr/bin/passenger-config validate-install
passed the apache config test, then you have multiple apache configs and the wrong one is being loaded when you get the error.
由于您的错误,配置文件位于 / usr / local / apache / conf /
,使用 fgrep -RH LoadModule / usr / local / apache / conf / <在配置中查找任何
LoadModule
行/ code>并添加一行以加载乘客模块。
From your error the conf is at /usr/local/apache/conf/
, look for any LoadModule
lines in the config with fgrep -RH LoadModule /usr/local/apache/conf/
and add a line to load the Passenger module.
这篇关于无效的命令“ PassengerAppRoot”,可能是服务器配置中未包含的模块拼写错误或定义了该命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!