Deploying a Rails app using Capistrano to an Ubuntu VM running Apache with Passenger enabled.
使用Capistrano将Rails应用程序部署到运行Apache且启用了Passenger的Ubuntu VM。
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.
我按照本教程:https://www.phusionpassenger.com/library/install/apache/install/oss/trusty/进行了一些更改,因为我是在17.04,而不是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.
passenger-config validate-install表示Passenger和Apache的一切看起来都很好。 passenger-memory-stats显示Passenger和Apache进程。
I have sudo apache2ctl restart
ed 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.
我有几次sudo apache2ctl重启,没有任何警告。但乘客状态,以及Capistrano运行的乘客配置重启应用程序,报告说Passenger“似乎没有运行”。所以我的部署停止了。
There's only one Ruby on the machine, ruby-2.4.1 installed using ruby-install. I have apt-get update
and upgrade
d in case of version mismatches.
机器上只有一个Ruby,使用ruby-install安装ruby-2.4.1。在版本不匹配的情况下,我有apt-get更新和升级。
Apache logs don't show any errors, certainly none related to Passenger.
Apache日志不会显示任何错误,当然也不会与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?
为什么Passenger在内部不同意,说它既配置正确又有进程运行,但后来说它没有运行?
2 个解决方案
#1
3
I needed to customize the instance registry directory, as suggested by Tony Vincent:
我需要根据Tony Vincent的建议自定义实例注册表目录:
/etc/apache2/mods-enabled/passenger.conf on the server:
服务器上的/etc/apache2/mods-enabled/passenger.conf:
PassengerInstanceRegistryDir /home/MYUSER/passenger_temp
config/deploy/production.rb in the Rails app:
Rails应用程序中的config / deploy / production.rb:
set :default_env, { 'PASSENGER_INSTANCE_REGISTRY_DIR' => '/home/MYUSER/passenger_temp' }
#2
1
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
.
很抱歉这是竖琴,但是你在ubuntu服务器(而不是osx)上运行了passenger-config validate-install吗?对于passenger-memory-stats和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 PassengerInstanceRegistryDir
s on Ubuntu so if Passenger is running there should be a dir in /tmp
that starts with passenger.
.
基于/ tmp没有passenger.randomstring目录,听起来你混淆了本地和远程命令。 / tmp是Ubuntu上PassengerInstanceRegistryDirs的默认位置,所以如果Passenger正在运行,那么/ tmp中的dir应该以乘客开头。
#1
3
I needed to customize the instance registry directory, as suggested by Tony Vincent:
我需要根据Tony Vincent的建议自定义实例注册表目录:
/etc/apache2/mods-enabled/passenger.conf on the server:
服务器上的/etc/apache2/mods-enabled/passenger.conf:
PassengerInstanceRegistryDir /home/MYUSER/passenger_temp
config/deploy/production.rb in the Rails app:
Rails应用程序中的config / deploy / production.rb:
set :default_env, { 'PASSENGER_INSTANCE_REGISTRY_DIR' => '/home/MYUSER/passenger_temp' }
#2
1
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
.
很抱歉这是竖琴,但是你在ubuntu服务器(而不是osx)上运行了passenger-config validate-install吗?对于passenger-memory-stats和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 PassengerInstanceRegistryDir
s on Ubuntu so if Passenger is running there should be a dir in /tmp
that starts with passenger.
.
基于/ tmp没有passenger.randomstring目录,听起来你混淆了本地和远程命令。 / tmp是Ubuntu上PassengerInstanceRegistryDirs的默认位置,所以如果Passenger正在运行,那么/ tmp中的dir应该以乘客开头。