我已按照中给出的每一个安装步骤进行操作在 Linux/Unix 生产服务器上安装 Passenger + Apache
适用于 Node.js 应用程序 + Red Hat 6 / CentOS 6(带 RPM) https://www.phusionpassenger.com/library/walkthroughs/deploy/nodejs/ownserver/apache/oss/el6/install_passenger.html一切正常,但是当我尝试使用 WHM 在 centos 6 服务器上的虚拟主机中配置子域来托管我的 botkit 机器人时,出现此错误:
“/usr/local/apache/bin/httpd”命令(进程 27088)报告
结束时出现错误编号 1。第 9 行检测到配置问题
文件/usr/local/apache/conf/includes/post_virtualhost_2.conf.tmp:
无效命令“PassengerAppRoot”,可能拼写错误或由
模块不包含在服务器配置中---
/usr/local/apache/conf/includes/post_virtualhost_2.conf.tmp --- 3
服务器别名 subdomain.mydomain.com 4 ServerAdmin[电子邮件受保护] /cdn-cgi/l/email-protection5 6 7 # 告诉 Apache 和 Passenger 你的位置
应用程序的代码目录是 8 DocumentRoot /var/www/MyApp/Code/public 9
===> PassengerAppRoot /var/www/MyApp/Code
这是我的配置:
<VirtualHost *:80>
ServerName www.subdomain.mydomain.com
ServerAlias subdomain.mydomain.com
ServerAdmin [email protected] /cdn-cgi/l/email-protection
# 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 的步骤是什么。