我有一个运行 rails 应用程序的 apache/passenger 服务器,当我尝试运行 transitive-status 时显示此错误:
passenger-status
ERROR: Phusion Passenger(R) 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(R) 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(R) Standalone's --instance-registry-dir command line argument.
相关进程的 LS
admin 3291 0.8 9.4 715484 291352 ? Sl 16:27 0:54 Passenger RubyApp: /srv/production/*******app1 (production)
admin 3721 0.0 2.9 483276 90736 ? Sl 08:27 0:03 Passenger RubyApp: /srv/production/********app2 (production)
admin 10963 0.0 0.0 13132 996 pts/0 S+ 18:17 0:00 grep --color=auto Pass
root 18477 0.0 0.2 399440 7964 ? Ssl 03:40 0:01 Passenger watchdog
root 18480 1.1 0.6 2682448 20956 ? Sl 03:40 10:09 Passenger core
这是 apache 文件夹中的乘客配置mods-available
:
LoadModule passenger_module /home/admin/.rvm/gems/ruby-2.5.5/gems/passenger-6.0.8/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/admin/.rvm/gems/ruby-2.5.5/gems/passenger-6.0.8
PassengerDefaultRuby /home/admin/.rvm/gems/ruby-2.5.5/wrappers/ruby
</IfModule>
我检查了 /tmp/ 文件夹,没有找到任何像乘客临时文件夹的东西。我如何找到和/或设置实例注册表目录?
答案1
出于安全原因,有一个 apache 选项会隐藏实例注册目录。可以通过PrivateTmp
在以下位置设置为 true 来更改它:/etc/systemd/system/multi-user.target.wants/apache2.service
一旦重新启动 apache,passenger-status 就可以正常工作。