我用乘客支持编译了nginx,但在我启动nginx(带乘客)之后,我的nodeJS应用程序没有启动。
以下是我的配置的更多细节。
nginx congiure file:
server {
listen 80;
server_name example.com www.example.com;
location / {
root /var/www/nodejs;
index index.html index.htm index.php;
}
location ~ ^/letsplay(/.*|$) {
alias /var/www/nodejs/letsplay/public$1;
passenger_base_uri /letsplay;
passenger_app_root /var/www/nodejs/letsplay;
passenger_document_root /var/www/nodejs/letsplay/public;
passenger_enabled on;
passenger_startup_file restserver.js;
}
}
乘客状态
Version : 4.0.45
Date : 2014-06-30 18:19:47 +0000
Instance: 19879
----------- General information -----------
Max pool size : 6
Processes : 0
Requests in top-level queue : 0
----------- Application groups -----------
这是nginx错误日志:
>
2014/06/30 18:33:42 [notice] 20046#0: using the "epoll" event method
[ 2014-06-30 18:33:42.0225 20047/7fd9f3cec780 agents/Base.cpp:1599 ]: Random seed: 1404153222
[ 2014-06-30 18:33:42.0226 20047/7fd9f3cec780 agents/Watchdog/Main.cpp:698 ]: Starting Watchdog...
[ 2014-06-30 18:33:42.0231 20047/7fd9f3cec780 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nobody', 'default_python' => 'python', 'default_ruby' => 'ruby', 'default_user' => 'nobody', 'log_level' => '2', 'max_pool_size' => '6', 'passenger_root' => '/home/danny/programms/passenger', 'passenger_version' => '4.0.45', '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.45', 'web_server_pid' => '20046', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '996', 'web_server_worker_uid' => '997' }
[ 2014-06-30 18:33:42.0280 20050/7fd6340c0780 agents/Base.cpp:1599 ]: Random seed: 1404153222
[ 2014-06-30 18:33:42.0281 20050/7fd6340c0780 agents/HelperAgent/Main.cpp:642 ]: Starting PassengerHelperAgent...
[ 2014-06-30 18:33:42.0297 20050/7fd6340c0780 agents/HelperAgent/Main.cpp:649 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.20046/generation-0/request
[ 2014-06-30 18:33:42.0367 20058/7f856ed59880 agents/Base.cpp:1599 ]: Random seed: 1404153222
[ 2014-06-30 18:33:42.0369 20058/7f856ed59880 agents/LoggingAgent/Main.cpp:333 ]: Starting PassengerLoggingAgent...
[ 2014-06-30 18:33:42.0377 20058/7f856ed59880 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.20046/generation-0/logging
[ 2014-06-30 18:33:42.0379 20047/7fd9f3cec780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
2014/06/30 18:33:42 [notice] 20046#0: nginx/1.6.0
2014/06/30 18:33:42 [notice] 20046#0: built by gcc 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC)
2014/06/30 18:33:42 [notice] 20046#0: OS: Linux 3.14.5-x86_64-linode42
2014/06/30 18:33:42 [notice] 20046#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2014/06/30 18:33:42 [notice] 20065#0: start worker processes
2014/06/30 18:33:42 [notice] 20065#0: start worker process 20066
[ 2014-06-30 18:33:42.6525 20000/7f1a8e1ea880 agents/LoggingAgent/Main.cpp:344 ]: Logging agent exiting with code 0.
[ 2014-06-30 18:33:42.6562 19992/7fd7b6257780 agents/HelperAgent/Main.cpp:605 ]: It's now 5 seconds after all clients have disconnected. Proceeding with graceful exit.
[ 2014-06-30 18:33:42.6563 19992/7fd7b6257780 agents/HelperAgent/Main.cpp:506 ]: Shutting down helper agent...
[ 2014-06-30 18:33:42.6566 19992/7fd7b6257780 agents/HelperAgent/Main.cpp:513 ]: Destroying application pool...
[ 2014-06-30 18:33:42.6745 20045/7f8b0fc0e780 agents/Watchdog/Main.cpp:388 ]: All Phusion Passenger agent processes have exited. Forcing all subprocesses to shut down.
[ 2014-06-30 18:33:42.6745 20045/7f8b0fc0e780 agents/Watchdog/Main.cpp:390 ]: Sending SIGTERM
[ 2014-06-30 18:33:43.6748 20045/7f8b0fc0e780 agents/Watchdog/Main.cpp:395 ]: Sending SIGKILL
[ 2014-06-30 18:33:45.0296 20050/7fd6340ad700 Pool2/Pool.h:827 ]: Analytics collection time...
[ 2014-06-30 18:33:45.0300 20050/7fd6340ad700 Pool2/Pool.h:930 ]: Analytics collection done; next analytics collection in 4.970 sec