Apache2 Passenger(Google Compute Engine)在 Ruby 版本上捕获 SIGTERM?
Apache2 Passenger (Google Compute Engine) catching SIGTERM over Ruby Version?
出于某种原因,Apache 似乎不喜欢我的 Rails 应用程序,运行 在 Google Compute Engine 上使用 Phusion Passenger(目前使用 WEBrick)。我在 Google 的 "Click-to-Deploy" ruby 实例上 运行 将其安装在 Debian 上 运行。我还将 Ruby 更新为 2.2.2 并设置了 rvm use global 2.2.2
.
我去 rails s
并启动服务器,转到 IP 地址,然后从 Apache 得到一个可爱的 500 Internal Error
说我的服务器配置一团糟。如果我尝试去 <ip_address>:3000
我没有得到服务器的响应。
配置文件(在/etc/apache2/sites-available/
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/nick/qwestera
RailsEnv production
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/home/nick/qwestera">
Options FollowSymLinks
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
日志(错误重复):
[ 2015-07-31 18:46:36.9094 8146/7f0809eaa720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Fri Jul 31 18:46:36 2015] [notice] Apache/2.2.22 (Debian) Phusion_Passenger/4.0.58 configured -- resuming normal operations
[Fri Jul 31 18:46:48 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:46:49 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:46:58 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:46:59 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:47:02 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:47:02 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:47:17 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:47:17 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:47:17 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:47:19 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:47:19 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:48:08 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:48:08 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:55:23 2015] [notice] caught SIGTERM, shutting down
[ 2015-07-31 18:55:24.5305 3807/7f317e333720 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/local/rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58', 'passenger_version' => '4.0.58', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.58', 'web_server_pid' => '5755', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2015-07-31 18:55:24.5352 3810/7fb4d8c13720 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.3806/generation-0/request
[ 2015-07-31 18:55:24.5413 3816/7f854bdf8740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.3806/generation-0/logging
[ 2015-07-31 18:55:24.5416 3807/7f317e333720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2015-07-31 18:55:24.5609 3832/7f94e6c6b720 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '$
[ 2015-07-31 18:55:24.5669 3840/7f6a6a654720 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.3827/generation-0/request
[ 2015-07-31 18:55:24.5730 3853/7f5623e51740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.3827/generation-0/logging
[ 2015-07-31 18:55:24.5733 3832/7f94e6c6b720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Fri Jul 31 18:55:24 2015] [notice] Apache/2.2.22 (Debian) Phusion_Passenger/4.0.58 configured -- resuming normal operations
[Fri Jul 31 18:55:54 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:55:54 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:55:59 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:55:59 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:56:01 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:56:01 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:56:46 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:56:46 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:56:49 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:56:49 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:58:37 2015] [notice] caught SIGTERM, shutting down
[ 2015-07-31 18:58:38.3388 4200/7f8f1041b720 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '$
[ 2015-07-31 18:58:38.3434 4203/7fe96b315720 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4199/generation-0/request
[ 2015-07-31 18:58:38.3489 4209/7fe051b12740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4199/generation-0/logging
[ 2015-07-31 18:58:38.3491 4200/7f8f1041b720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2015-07-31 18:58:38.3672 4225/7fcc75d26720 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '$
[ 2015-07-31 18:58:38.3725 4233/7f79a2e4c720 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4220/generation-0/request
[ 2015-07-31 18:58:38.3790 4244/7f0bef1b9740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4220/generation-0/logging
[ 2015-07-31 18:58:38.3792 4225/7fcc75d26720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Fri Jul 31 18:58:38 2015] [notice] Apache/2.2.22 (Debian) Phusion_Passenger/4.0.58 configured -- resuming normal operations
[Fri Jul 31 18:58:50 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:58:50 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:58:53 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:58:53 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
我认为 的日志条目可能会给我一些见解:
[Fri Jul 31 18:55:23 2015] [notice] caught SIGTERM, shutting down
[ 2015-07-31 18:55:24.5305 3807/7f317e333720 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/local/rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58', 'passenger_version' => '4.0.58', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.58', 'web_server_pid' => '5755', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
具体来说:
'default_ruby' => '/usr/local/rvm/gems/ruby-2.1.1/wrappers/ruby',
'passenger_root' =>
'/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58'
如果您注意到了,我说我将 ruby 更新为 2.2.2
,因为这就是我正在尝试 运行 使用的项目。但是,Apache 有 default_ruby
和 passenger_root
目录,其中包括 ruby 2.1.1
。这会是问题吗?如果是这样,我该如何更改?
UPDATE:
删除 Require all granted
让我更近了一步(此行仅适用于大于 2.4 的 Apache 版本,我的版本是 2.2)。
现在我得到了一个乘客页面(显示了我的 rails 应用程序的 favicon.ico,耶!),让我知道 Web application could not be started
。
它向我显示了以下错误:
Your Ruby version is 2.1.1, but your Gemfile specified 2.2.2 (Bundler::RubyVersionMismatch)
/usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/definition.rb:390:in `validate_ruby!'
/usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler.rb:115:in `setup'
/usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/setup.rb:17:in `<top (required)>'
/usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
/usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
/usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/lib/phusion_passenger/loader_shared_helpers.rb:263:in `block in run_load_path_setup_code'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/lib/phusion_passenger/loader_shared_helpers.rb:366:in `running_bundler'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/lib/phusion_passenger/loader_shared_helpers.rb:261:in `run_load_path_setup_code'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/helper-scripts/rack-preloader.rb:100:in `preload_app'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/helper-scripts/rack-preloader.rb:28:in `<main>'
细分:
我完全说是Ruby版本问题!现在,我如何让乘客知道在 2.2.2 的新 Ruby 目录中查找内容?
有趣且可能有见地:
$ ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
$ ruby -version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
-e:1:in `<main>': undefined local variable or method `rsion' for main:Object (NameError)
ruby -version
returns一个NameError
,但是ruby --version
没有。什么鬼?
UPDATE 2:
好吧,我已经更新了 /etc/apache2/apache2.conf 以指向新目录。但是,我的 rails 应用程序实际上并不是 运行ning。我只看到我的应用程序中所有文件和文件夹的索引。我如何让它开始?
解决方法是使用 rvm uninstall 2.1.1
卸载旧版本 Ruby,使用 rvm install 2.2.2
重新安装新版本,然后使用 passenger-install-apache2-module
.
再次安装 passenger
出于某种原因,Apache 似乎不喜欢我的 Rails 应用程序,运行 在 Google Compute Engine 上使用 Phusion Passenger(目前使用 WEBrick)。我在 Google 的 "Click-to-Deploy" ruby 实例上 运行 将其安装在 Debian 上 运行。我还将 Ruby 更新为 2.2.2 并设置了 rvm use global 2.2.2
.
我去 rails s
并启动服务器,转到 IP 地址,然后从 Apache 得到一个可爱的 500 Internal Error
说我的服务器配置一团糟。如果我尝试去 <ip_address>:3000
我没有得到服务器的响应。
配置文件(在/etc/apache2/sites-available/
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/nick/qwestera
RailsEnv production
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/home/nick/qwestera">
Options FollowSymLinks
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
日志(错误重复):
[ 2015-07-31 18:46:36.9094 8146/7f0809eaa720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Fri Jul 31 18:46:36 2015] [notice] Apache/2.2.22 (Debian) Phusion_Passenger/4.0.58 configured -- resuming normal operations
[Fri Jul 31 18:46:48 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:46:49 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:46:58 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:46:59 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:47:02 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:47:02 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:47:17 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:47:17 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:47:17 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:47:19 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:47:19 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:48:08 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:48:08 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:55:23 2015] [notice] caught SIGTERM, shutting down
[ 2015-07-31 18:55:24.5305 3807/7f317e333720 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/local/rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58', 'passenger_version' => '4.0.58', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.58', 'web_server_pid' => '5755', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2015-07-31 18:55:24.5352 3810/7fb4d8c13720 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.3806/generation-0/request
[ 2015-07-31 18:55:24.5413 3816/7f854bdf8740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.3806/generation-0/logging
[ 2015-07-31 18:55:24.5416 3807/7f317e333720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2015-07-31 18:55:24.5609 3832/7f94e6c6b720 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '$
[ 2015-07-31 18:55:24.5669 3840/7f6a6a654720 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.3827/generation-0/request
[ 2015-07-31 18:55:24.5730 3853/7f5623e51740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.3827/generation-0/logging
[ 2015-07-31 18:55:24.5733 3832/7f94e6c6b720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Fri Jul 31 18:55:24 2015] [notice] Apache/2.2.22 (Debian) Phusion_Passenger/4.0.58 configured -- resuming normal operations
[Fri Jul 31 18:55:54 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:55:54 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:55:59 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:55:59 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:56:01 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:56:01 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:56:46 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:56:46 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:56:49 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:56:49 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:58:37 2015] [notice] caught SIGTERM, shutting down
[ 2015-07-31 18:58:38.3388 4200/7f8f1041b720 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '$
[ 2015-07-31 18:58:38.3434 4203/7fe96b315720 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4199/generation-0/request
[ 2015-07-31 18:58:38.3489 4209/7fe051b12740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4199/generation-0/logging
[ 2015-07-31 18:58:38.3491 4200/7f8f1041b720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2015-07-31 18:58:38.3672 4225/7fcc75d26720 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '$
[ 2015-07-31 18:58:38.3725 4233/7f79a2e4c720 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4220/generation-0/request
[ 2015-07-31 18:58:38.3790 4244/7f0bef1b9740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4220/generation-0/logging
[ 2015-07-31 18:58:38.3792 4225/7fcc75d26720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Fri Jul 31 18:58:38 2015] [notice] Apache/2.2.22 (Debian) Phusion_Passenger/4.0.58 configured -- resuming normal operations
[Fri Jul 31 18:58:50 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:58:50 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
[Fri Jul 31 18:58:53 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /
[Fri Jul 31 18:58:53 2015] [crit] [client 98.117.13.138] configuration error: couldn't perform authentication. AuthType not set!: /favicon.ico, referer: http://130.211.115.98/
我认为 的日志条目可能会给我一些见解:
[Fri Jul 31 18:55:23 2015] [notice] caught SIGTERM, shutting down
[ 2015-07-31 18:55:24.5305 3807/7f317e333720 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/local/rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58', 'passenger_version' => '4.0.58', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.58', 'web_server_pid' => '5755', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
具体来说:
'default_ruby' => '/usr/local/rvm/gems/ruby-2.1.1/wrappers/ruby',
'passenger_root' => '/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58'
如果您注意到了,我说我将 ruby 更新为 2.2.2
,因为这就是我正在尝试 运行 使用的项目。但是,Apache 有 default_ruby
和 passenger_root
目录,其中包括 ruby 2.1.1
。这会是问题吗?如果是这样,我该如何更改?
UPDATE:
删除 Require all granted
让我更近了一步(此行仅适用于大于 2.4 的 Apache 版本,我的版本是 2.2)。
现在我得到了一个乘客页面(显示了我的 rails 应用程序的 favicon.ico,耶!),让我知道 Web application could not be started
。
它向我显示了以下错误:
Your Ruby version is 2.1.1, but your Gemfile specified 2.2.2 (Bundler::RubyVersionMismatch)
/usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/definition.rb:390:in `validate_ruby!'
/usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler.rb:115:in `setup'
/usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/setup.rb:17:in `<top (required)>'
/usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
/usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
/usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/lib/phusion_passenger/loader_shared_helpers.rb:263:in `block in run_load_path_setup_code'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/lib/phusion_passenger/loader_shared_helpers.rb:366:in `running_bundler'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/lib/phusion_passenger/loader_shared_helpers.rb:261:in `run_load_path_setup_code'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/helper-scripts/rack-preloader.rb:100:in `preload_app'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.58/helper-scripts/rack-preloader.rb:28:in `<main>'
细分: 我完全说是Ruby版本问题!现在,我如何让乘客知道在 2.2.2 的新 Ruby 目录中查找内容?
有趣且可能有见地:
$ ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
$ ruby -version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
-e:1:in `<main>': undefined local variable or method `rsion' for main:Object (NameError)
ruby -version
returns一个NameError
,但是ruby --version
没有。什么鬼?
UPDATE 2:
好吧,我已经更新了 /etc/apache2/apache2.conf 以指向新目录。但是,我的 rails 应用程序实际上并不是 运行ning。我只看到我的应用程序中所有文件和文件夹的索引。我如何让它开始?
解决方法是使用 rvm uninstall 2.1.1
卸载旧版本 Ruby,使用 rvm install 2.2.2
重新安装新版本,然后使用 passenger-install-apache2-module
.