将rails应用程序从webrick更改为乘客

时间:2011-07-21 10:41:26

标签: ruby-on-rails apache passenger webrick

需要一些帮助将一个rails应用程序从webrick移动到带有apache的乘客。我对这一切都很新,我不能让它与乘客一起运行。我已经尝试了一堆指南,除了rails服务器总是使用webrick而不是乘客,我没有遇到任何错误。我正在使用mac mini OSX作为服务器

我看到osx附带了已经安装的mac版本,但我在线阅读我应该加载一个较新的副本,所以我确保当前安装的apache没有在系统首选项/共享/ Web共享中运行。

然后我brew install apachetop。然后是gem install passengerpassenger-install-apache2-module

然后我按照终端乘客的说明,要求我在httpd.conf文件中放置一些代码。我在/ ect / apache2中找到了root。

然后我将虚拟主机信息添加到apache配置文件中/ public / mom是我的rails应用程序的位置。

<VirtualHost *>
    ServerName localhost:3000
    DocumentRoot /public/mom
    RailsEnv development 
    <Directory /public/mom>
         AllowOverride all
         Options -MultiViews
    </Directory>
</VirtualHost>

然后我确保apache正在运行sudo apachectl start并尝试运行我的rails服务器,但它仍然使用webrick运行。

我看过帖子说我需要确保乘客正在安装我安装的正确版本的apache。我如何强制乘客安装我安装的apache而不是默认?我想将配置文件中的servername命名为localhost吗?任何人都可以给我一些关于如何让rails应用程序与乘客一起运行的指导。也许我错过了一些步骤或完全误解了这个过程。感谢

编辑:下面是apache error_log

    [Wed Jul 20 19:17:01 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
httpd: Could not reliably determine the server's fully qualified domain name, using mini.local for ServerName
[Wed Jul 20 19:17:02 2011] [notice] Digest: generating secret for digest authentication ...
[Wed Jul 20 19:17:02 2011] [notice] Digest: done
[Wed Jul 20 19:17:02 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8r DAV/2 Phusion_Passenger/3.0.7 configured -- resuming normal operations
[Wed Jul 20 19:17:22 2011] [notice] caught SIGTERM, shutting down
[Wed Jul 20 19:39:32 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
httpd: Could not reliably determine the server's fully qualified domain name, using mini.local for ServerName
[Wed Jul 20 19:39:45 2011] [notice] Digest: generating secret for digest authentication ...
[Wed Jul 20 19:39:45 2011] [notice] Digest: done
[Wed Jul 20 19:39:45 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8r DAV/2 Phusion_Passenger/3.0.7 configured -- resuming normal operations
[Wed Jul 20 19:43:33 2011] [notice] caught SIGTERM, shutting down
[Wed Jul 20 20:09:35 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
Warning: DocumentRoot [/public/mom] does not exist
httpd: Could not reliably determine the server's fully qualified domain name, using mini.local for ServerName
[Wed Jul 20 20:09:35 2011] [notice] Digest: generating secret for digest authentication ...
[Wed Jul 20 20:09:35 2011] [notice] Digest: done
[Wed Jul 20 20:09:35 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8r DAV/2 Phusion_Passenger/3.0.7 configured -- resuming normal operations
[Thu Jul 21 10:36:59 2011] [notice] caught SIGTERM, shutting down

1 个答案:

答案 0 :(得分:0)

“尝试运行我的rails服务器,但它仍然使用webrick运行”,似乎你的webrick仍处于活动状态。

lsof -i -P |grep 3000
kill -9 WEBRICK_PID