【问题标题】:Apache + Phusion Passenger. Ubuntu 18.04. passenger process getting killed after working several hours阿帕奇 + Phusion 乘客。 Ubuntu 18.04。工作几个小时后乘客进程被杀死
【发布时间】:2020-11-08 03:34:26
【问题描述】:

我有带有 apache + 乘客 6.0.4 设置的 RoR 应用程序。由 DigitalOcean 主办。 它按预期工作了大约 6 个月,但最近它每隔几个小时就开始从 apache 端出现“内部服务器错误”而失败。重启apache后就开始正常工作了。

在数字海洋中,我可以看到当这个错误开始出现时,CPU 开始经常旋转到 100%。cpu metric screenshot

在 apache error.log 文件中,我可以看到对服务器的每个请求都会出现此错误:

Unexpected error in mod_passenger: Cannot connect to the Passenger core at unix:/root/passenger/passenger.V1HJ9DZ/agents.s/core
  Backtrace:
     in 'Passenger::FileDescriptor Passenger::Apache2Module::Hooks::connectToCore()' (Hooks.cpp:343)
     in 'int Passenger::Apache2Module::Hooks::handleRequest(request_rec*)' (Hooks.cpp:622)

在这些错误开始出现之前,我没有在 error.log 文件中发现任何特定错误。

发生这种情况时,apache 状态页面中没有乘客进程。 乘客状态显示此错误:

ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it is running, then the causes of this problem could be:

1. You customized the instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command-line argument. If so, please set the environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory and run passenger-status again.
2. The instance directory has been removed by an operating system background service. Please set a different instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command-line argument.

我已经尝试过这些解决方案:

  1. PassengerRegistryDir/tmp 移动到 /root/passenger。 我检查了乘客档案:他们没有被清除,所以他们没有问题。 当我手动删除这些文件时,我得到了同样的错误,但乘客进程正在运行。
  2. 启用mod_evasive 以保护服务器免受dos 攻击。
  3. 设置PassengerPoolIdleTime 0
  4. 检查 rails 日志文件 - 没有具体错误。

我认为不知何故乘客进程被系统或其他东西杀死。

【问题讨论】:

    标签: ruby-on-rails apache passenger


    【解决方案1】:

    几天后,我们发现我们的网络服务器受到 ddos​​ 攻击 + 加密挖掘恶意软件。

    fail2ban 帮助了 ddos​​。 带有恶意软件的 clamscan。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多