我正在使用带apache的乘客来运行我的ruby应用程序。我注意到乘客不时崩溃(apache仍在工作),我需要手动重启apache以使其再次运行。
查看日志会让我觉得当apache更改日志文件时会发生这种情况(将当前文件归档并创建一个新文件)。这是tha apache错误日志文件的tail -F
:
tail: ‘/var/log/apache2/error.log’ has become inaccessible: No such file or directory
tail: ‘/var/log/apache2/error.log’ has appeared; following end of new file
[ 2013-10-06 05:05:27.2678 10498/7f3f0cf82740 agents/Watchdog/Main.cpp:459 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby1.9.1', 'default_user' => 'nobody', 'log_level' => '0', 'max_instances_per_app' => '0', 'max_pool_size' => '6', 'passenger_root' => '/var/lib/gems/1.9.1/gems/passenger-4.0.14', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_pid' => '18659', 'web_server_type' => 'apache', 'web_server_worker_gid' => '1000', 'web_server_worker_uid' => '1001' }
[Sun Oct 06 05:05:27 2013] [error] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Tried to reuse existing server instance directory /tmp/passenger.1.0.18659, but it has wrong permissions
[Sun Oct 06 05:05:27 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.9-4ubuntu2.2 Phusion_Passenger/4.0.14 configured -- resuming normal operations
/tmp
中的文件错误,他们为什么错了?它们应该是什么?如何使它们正确?答案 0 :(得分:2)
啊,我看到你的版本是4.0.14。请升级到最新版本,即4.0.20。 4.0.17之前的版本没有使用setgid标志正确支持/ tmp目录。
答案 1 :(得分:1)
就我而言,重启apache解决了这个问题。
$ /etc/init.d/httpd stop
$ /etc/init.d/httpd start