我已按照Installing Passenger + Apache on a Linux/Unix production server for Node.js apps + Red Hat 6 / CentOS 6 (with RPM)中的每个步骤进行安装,一切正常但是当我尝试在我的centos 6服务器上使用WHM来托管我的botkit bot的虚拟主机中配置我的子域时,我收到此错误:
“/ 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和Passenger你的应用程序的代码目录是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#告诉乘客你的app是一个Node.js应用程序15 PassengerAppType节点--- /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传递:
PassengerEnabled on
PassengerAppRoot /var/www/MyApp/code
SetEnv NODE_ENV production
SetEnv NODE_PATH /usr/lib/node_modules
PassengerAppType node
PassengerStartupFile bot.js
但它仍然无法正常工作 . 我最近检查过并在验证乘客时收到以下消息:
* 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的步骤是什么 .
1 回答
该错误意味着在指定Passenger配置选项之前,Passenger模块尚未在apache配置中加载
LoadModule passenger_module /path/to/.../passenger/buildout/apache2/mod_passenger.so
行 .如果
sudo /usr/bin/passenger-config validate-install
通过了apache配置测试,那么你有多个apache配置,并且当你收到错误时正在加载错误的配置 .根据您的错误,conf位于
/usr/local/apache/conf/
,使用fgrep -RH LoadModule /usr/local/apache/conf/
在配置中查找任何LoadModule
行,并添加一行以加载Passenger模块 .