需要一些帮助将 Rails 应用程序从 webrick 移动到使用 apache 的乘客。我对这一切都很陌生,我无法让它与乘客一起运行。我已经尝试了一堆指南,除了总是使用 webrick 而不是乘客的 rails 服务器之外,我没有收到任何错误。我正在使用 mac mini OSX 作为服务器
我看到 osx 附带了一个已经安装的 mac 版本,但我在网上看到我应该加载一个更新的副本,所以我确保当前安装的 apache 没有在系统首选项/共享/网络共享中运行。
然后我brew install apachetop
。其次是gem install passenger
和passenger-install-apache2-module
。
然后我按照终端乘客的指示,要求我在 httpd.conf 文件中放置一些代码。我从根目录中找到 /ect/apache2 。
然后,我也将虚拟主机信息添加到 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 而不是默认安装?我是否应该将配置文件中的服务器名称命名为 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