본문 바로가기
OS/Linux

[Linux] AWS Ubuntu 서버 재가동시 대처방안 정리

by pcm9881 2022. 7. 25.

이슈 

  1. AWS EC2 1개 서버가 제기능을 못하고 있는걸 확인.
  2. AWS EC2 재부팅 진행.
  3. 기존 nginx, tomcat 웹서버 재가동 진행.
  4. nginx 계속 서버 구동이 안됨.
  5. apache 서버 구동 port와 충돌로 생긴 이슈. (port crash)
  6. apache 서버 종료 후 nginx 서버 구동.
  7. 정상 동작확인.

Nginx 구동 에러 화면

- nginx 상태 확인 명령어.

sudo service nginx status

- nginx 상태 확인 화면.

- 아래 내용 복사. ( ip 부분은 삭제 )

● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2022-07-25 00:56:23 UTC; 32s ago
Docs: man:nginx(8)
Process: 3138 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 3139 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Jul 25 00:56:20                              systemd[1]: Starting A high performance web server and a reverse proxy server...
Jul 25 00:56:20                              nginx[3139]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 25 00:56:21                              nginx[3139]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 25 00:56:21                              nginx[3139]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 25 00:56:22                              nginx[3139]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 25 00:56:22                              nginx[3139]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 25 00:56:23                              nginx[3139]: nginx: [emerg] still could not bind()
Jul 25 00:56:23                              systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jul 25 00:56:23                              systemd[1]: nginx.service: Failed with result 'exit-code'.
Jul 25 00:56:23                              systemd[1]: Failed to start A high performance web server and a reverse proxy server.

 

Ubuntu Port 확인

sudo lsof -i -P -n | grep LISTEN

 

 

728x90

'OS > Linux' 카테고리의 다른 글

[Linux] Ubuntu 20.04 NodeJS 16 설치  (0) 2022.10.20
[Linux] Ubuntu NGINX 설치  (0) 2022.09.28
[Linux] Ubuntu 현재 버전 확인  (0) 2022.09.28
[Linux] Ubuntu 20.04 zsh, oh-my-zsh 설치  (0) 2022.09.28
[Linux] Ubuntu 20.04 유저 생성  (0) 2022.09.28

댓글