.png)
방금 Bluehost에서 vps를 설정했습니다. Centos 6. 2일 동안 내 nginx 서버가 닫히고 다음을 기록합니다.
[ ... ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
nginx를 여러 번 다시 시작하고, 실행 수준을 확인하고, 실행 중인 한 쌍의 앱으로 테스트했습니다... 하지만 nginx가 계속 종료되는 것을 막을 수는 없습니다.
그래서 여기저기 찾아봤습니다. StackOverflow에서승객 작성자는 지침에 따라 다시 설치하도록 권장합니다., 나는 (두 번) 더 나은 결과를 얻지 못했습니다.
더 많이 파헤쳐 보면 이것을 발견했습니다.비슷한 질문아직 좋은 대답이 없습니다.
좀 더 찾아보니,해결책내 경우처럼 Rails 앱과 관련된 serverfault에서. 그런데 고무를 사용하지 않았기 때문에 Rubber-passenger_nginx.yml을 찾을 수 없습니다.
최신 버전을 컴파일하기 위해 nginx, 승객(서버에 yum으로 설치되고 앱에 gem으로 포함됨), rvm, Ruby, my Rails 앱 구성을 다시 확인했습니다. 다 괜찮아. 그러나 nginx는 중지됩니다. 도와주세요...
의견을 보내주신 @drookie에게 감사드립니다. 몇 가지 정보를 수집하고 Linux에서 SIGINT를 추적하는 방법을 배우려고 합니다. 최근 설치 시에도 동일한 오류, 설치 시 첫 번째 오류가 발생하는 트랙입니다. GET /whm-server-status HTTP/1.0에 대해 404개 중 100개를 얻었습니다(nginx가 아파치를 요청하는 이유는 무엇입니까?).
App 17918 stdout:
App 18051 stdout:
2015/09/28 23:15:01 [error] 14602#0: *179 open() "/usr/share/nginx/html/whm-server-status" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /whm-server-status HTTP/1.0"
[ 2015-09-28 23:16:03.2224 14578/7f23d3390700 age/Cor/CoreMain.cpp:793 ]: Disconnecting long-running connections for process 18051, application /home/user/ror/app/current/public
[ 2015-09-28 23:16:55.1231 14578/7f23d28bc700 age/Cor/CoreMain.cpp:506 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ 2015-09-28 23:16:55.1232 14578/7f23d33d2800 age/Cor/CoreMain.cpp:875 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ 2015-09-28 23:16:55.1232 14578/7f23d33d2800 age/Cor/CoreMain.cpp:793 ]: Disconnecting long-running connections for process 14734, application /home/user/ror/app/current/public
[ 2015-09-28 23:16:55.1237 14578/7f23d28bc700 Ser/Server.h:758 ]: [ServerThr.1] Freed 128 spare client objects
[ 2015-09-28 23:16:55.1238 14578/7f23d28bc700 Ser/Server.h:443 ]: [ServerThr.1] Shutdown finished
[ 2015-09-28 23:16:55.1238 14578/7f23d1e3a700 Ser/Server.h:758 ]: [ServerThr.2] Freed 128 spare client objects
[ 2015-09-28 23:16:55.1238 14578/7f23d1e3a700 Ser/Server.h:443 ]: [ServerThr.2] Shutdown finished
[ 2015-09-28 23:16:55.1241 14578/7f23d13b8700 Ser/Server.h:758 ]: [ApiServer] Freed 0 spare client objects
[ 2015-09-28 23:16:55.1241 14583/7fd4931c3700 age/Ust/UstRouterMain.cpp:396 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ 2015-09-28 23:16:55.1241 14578/7f23d13b8700 Ser/Server.h:443 ]: [ApiServer] Shutdown finished
[ 2015-09-28 23:16:55.1242 14583/7fd493453800 age/Ust/UstRouterMain.cpp:466 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ 2015-09-28 23:16:55.1242 14578/7f23d33d2800 age/Cor/CoreMain.cpp:793 ]: Disconnecting long-running connections for process 14734, application /home/user/ror/app/current/public
[ 2015-09-28 23:16:55.1242 14583/7fd492741700 Ser/Server.h:758 ]: [UstRouterApiServer] Freed 0 spare client objects
[ 2015-09-28 23:16:55.1242 14583/7fd492741700 Ser/Server.h:443 ]: [UstRouterApiServer] Shutdown finished
[ 2015-09-28 23:16:55.1244 14583/7fd4931c3700 Ser/Server.h:443 ]: [UstRouter] Shutdown finished
[ 2015-09-28 23:16:55.1245 14583/7fd493453800 age/Ust/UstRouterMain.cpp:497 ]: Passenger UstRouter shutdown finished
[ 2015-09-28 23:16:55.3360 14578/7f23d33d2800 age/Cor/CoreMain.cpp:941 ]: Passenger core shutdown finished
추신 : alx | grep nginx 출력:
1 0 374 1 20 0 108560 1864 rt_sig Ss ? 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
5 399 375 374 20 0 109000 3132 ep_pol S ? 0:00 nginx: worker process
0 500 593 32668 20 0 103304 832 - R+ pts/0 0:00 grep nginx
여기 /etc/nginx/nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
client_max_body_size 5M;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 3;
#gzip on;
index index.html index.htm;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80 default_server;
server_name localhost;
root /usr/share/nginx/html;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
# redirect server error pages to the static page /40x.html
#
error_page 404 /404.html;
location = /40x.html {
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}
답변1
문제를 발견했는데 nginx나 승객이 아니었습니다. 서버에 WHM이 설치되어 있었습니다. 따라서 제어판의 보안은 내가 bash에서 내린 명령을 변경하는 것이었습니다. 또한 설치가 오래되었습니다. whm이 업데이트되고 올바르게 사용되면 nginx 종료 문제가 해결되었습니다. @drookie, 당신 말이 맞았습니다. 단순한 데몬이 아니라 전체적인 원인이 원인이었습니다. 감사해요.