更新:输入“乘客记忆统计”时,我显示:
---Passenger processes---
Processes: 0
我该如何解决这个问题?为什么即使我在 httpd.conf 中添加并重新启动 apache,乘客也不会启动?
我无法让 Phusion Passenger 在服务器上运行 Ruby on Rails。我已经按照 Phusion 网站上的所有说明安装了乘客并修改并创建了 Apache VirtualHost 以指向新目录并验证所有 .conf 文件都已成功加载。还加载了 httpd -M 乘客模块。我还在本地主机上成功运行了Passenger Standalone 和Rails 服务器webrick,并且能够验证它是否可以与curl 一起使用。
但是当我尝试从浏览器运行我的域时,我只得到一个 404 not found 或一个空索引文件,我在 VirtualHost 下的 DocumentRoot 指定的文件夹中创建(所以我知道它正在加载 .conf 并进入正确的目录) 但它没有加载 Rails 应用程序....有人可以指出我做错了什么吗?这是我的设置和配置:
ruby -v:
ruby 2.1.2p95
rails -v:
Rails 4.2.3
passenger -v:
Phusion Passenger version 5.0.15
httpd -v:
Apache/2.2.27 (Unix)
opearting system:
CentOS
uname -i:
x86_64
httpd.conf:
Include "/usr/local/apache/conf/includes/mydomain.conf"
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-5.0.15/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-5.0.15
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.1.2/wrappers/ruby
</IfModule>
/usr/local/apache/conf/includes/mydomain.conf:
<VirtualHost 208.79.235.241:80>
ServerName mydomain.com
DocumentRoot /home/clevert/public_html/rails_apps/mydomain.com/public
PassengerRuby /usr/local/rvm/gems/ruby-2.1.2/wrappers/ruby
<Directory /home/clevert/public_html/rails_apps/mydomain.com/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
关于 ruby 命令的乘客配置:
Command: /usr/local/rvm/gems/ruby-2.1.2/wrappers/ruby
乘客配置验证安装:
Checking whether this Passenger install is in PATH... ✓
Checking whether there are no other Passenger installations... ✓
Checking whether Apache is installed... ✓
Checking whether the Passenger module is correctly configured in Apache... ✓
Everything looks good. :-)