3

我对乘客有误。

我在VPS中设置了redmine。当我在 webrick 中运行时,它运行正常。我曾经乘客在 80 端口运行 redmine。

路径:usr/local/apache/conf/httpd.conf

 LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
 PassengerRuby /usr/bin/ruby
 PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17

 PassengerMaxPoolSize 2
 PassengerMaxInstancesPerApp 2
 PassengerPoolIdleTime 100


 <VirtualHost 112.78.6.191:80>
    ServerName projects.gzerone.com
    ServerAlias www.projects.gzerone.com
    DocumentRoot /home/gzerone/public_html/redmine-2.1.2/public
RailsEnv production
     #ErrorLog /usr/local/apache/logs/redmine.error.log
#RackBaseURI /rails
     ServerAdmin webmaster@projects.gzerone.com
     #UseCanonicalName Off
    #CustomLog /usr/local/apache/domlogs/projects.gzerone.com combined
    #CustomLog /usr/local/apache/domlogs/projects.gzerone.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
     ## User gzerone # Needed for Cpanel::ApacheConf
<Directory /home/gzerone/public_html/redmine-2.1.2/public>
    #AllowOverride all
     Allow from all
    # MultiViews must be turned off.
    Options -MultiViews
</Directory>

<IfModule mod_suphp.c>
    suPHP_UserGroup gzerone gzerone
</IfModule>
<IfModule !mod_disable_suexec.c>
    <IfModule !mod_ruid2.c>
        SuexecUserGroup gzerone gzerone
    </IfModule>
</IfModule>
<IfModule mod_ruid2.c>
    RUidGid gzerone gzerone
</IfModule>
ScriptAlias /cgi-bin/ /home/gzerone/public_html/redmine-2.1.2/public/cgi-bin/


# To customize this VirtualHost use an include file at the following location
# Include "/usr/local/apache/conf/userdata/std/2/gzerone/projects.gzerone.com/*.conf"

在此处输入图像描述

在 apache 的 error_log 中:

[ pid=23984 thr=23634338875820 file=utils.rb:176 time=2012-11-23 10:39:34.067 ]: *** Exception Errno::ENOMEM in PhusionPassenger::Rack::ApplicationSpawner (Cannot allocate memory - fork(2)) (process 23984, thread #<Thread:0x2afd98bf1358>):
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/utils.rb:462:in `fork'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/utils.rb:462:in `safe_fork'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:180:in `start'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rack_application'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rack_application'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.17/helper-scripts/passenger-spawn-server:99

我希望。你提出任何修复它的建议。

4

2 回答 2

1

正如您在日志中看到的,ApplicationSpawner 由于内存不足错误而崩溃。你没有足够的内存。

您可以做几件事:

  • 使用保守派生,这样您就没有 ApplicationSpawner 进程。由于您的池大小只有 2,因此使用 ApplicationSpawner 不会给您带来任何优势。
  • 添加更多交换空间。
  • 升级你的内存。
于 2013-03-16T19:20:48.443 回答
0

有同样的问题,我相信它与乘客控制和优化选项有关,例如PassengerMaxPoolSize。您可能需要将其设置为高于 2。我注意到有人第一次在另一台计算机上同步查看我的应用程序时发生了错误。

要快速修复,请尝试进入项目目录并重新捆绑应用程序,bundle install然后重新启动 Web 服务器,sudo service httpd restart这应该会重置乘客。

此外,丢失的config.ru文件会导致相同的错误消息。您可能想查看这里的讨论。

希望我能告诉你为什么会这样,希望有人会。我很想了解我自己的确切问题,以永久修复。

于 2013-03-14T00:23:03.760 回答