Passenger doesn't seem to be running (Capistrano/Rails/Apache/Ubuntu)

假如想象 提交于 2020-01-01 09:12:14

问题


Deploying a Rails app using Capistrano to an Ubuntu VM running Apache with Passenger enabled.

I followed this tutorial: https://www.phusionpassenger.com/library/install/apache/install/oss/trusty/ with a few changes given that I'm on 17.04, not 14.04 LTS.

passenger-config validate-install says everything looks fine with both Passenger and Apache. passenger-memory-stats shows both Passenger and Apache processes.

I have sudo apache2ctl restarted several times, with no warnings. But passenger-status, and therefore the passenger-config restart-app that Capistrano runs, reports that Passenger "doesn't seem to be running." So my deploy stops.

There's only one Ruby on the machine, ruby-2.4.1 installed using ruby-install. I have apt-get update and upgraded in case of version mismatches.

Apache logs don't show any errors, certainly none related to Passenger.

Why would Passenger internally disagree, saying that it's both configured properly and there are processes running, but then later saying that it's not running?


回答1:


I needed to customize the instance registry directory, as suggested by Tony Vincent:

/etc/apache2/mods-enabled/passenger.conf on the server:

PassengerInstanceRegistryDir /home/MYUSER/passenger_temp

config/deploy/production.rb in the Rails app:

set :default_env, { 'PASSENGER_INSTANCE_REGISTRY_DIR' => '/home/MYUSER/passenger_temp' }



回答2:


Sorry to harp on this but did you run passenger-config validate-install on the ubuntu server (not osx)? Same for passenger-memory-stats and sudo apache2ctl restart.

Based on /tmp not having a passenger.randomstring dir, it sounds like you are confusing local and remote commands. /tmp is the default location for PassengerInstanceRegistryDirs on Ubuntu so if Passenger is running there should be a dir in /tmp that starts with passenger..



来源:https://stackoverflow.com/questions/46058728/passenger-doesnt-seem-to-be-running-capistrano-rails-apache-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!