systemctl이 nginx를 시작하지 못했습니다.

systemctl이 nginx를 시작하지 못했습니다.

면책조항: 저는 서버 관리 경험이 없으므로 잘못된 단어 선택과 문제 설명에 대한 노력 부족을 이해해 주시기 바랍니다. 나는 내가 무엇을 하고 있는지 정말로 몰랐다.

아무튼 따라해봤습니다이 기사모든 도메인에 필요한 SSL 인증서를 자동으로 생성하여 다음과 같은 결과를 얻었습니다.문서nginx 확장을 설치하면 이 작업을 수행할 수 있습니다. 요구 사항 섹션을 탐색하기 시작했고 첫 번째 섹션을 계속 설치했습니다.오픈레스티, 나는 이것이 nginx 모듈을 확장한다고 믿습니다. 나는 팔로우한다설치 과정, 설치를 위해 nginx를 종료하는 초기 명령을 실행하십시오.

sudo systemctl disable nginx
sudo systemctl stop nginx

설치는 순조롭게 진행됐는데 nginx를 다시 시작하려고 하면

sudo systemctl enable nginx
sudo systemctl start nginx

마지막 명령에서 오류가 발생합니다.

Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

이는 sudo systemctl status nginx.service다음을 알려줍니다.

● 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 Fri 2020-06-19 11:50:25 UTC; 5min ago
  Process: 2160 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 2157 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Jun 19 11:50:22 staging nginx[2160]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 19 11:50:23 staging nginx[2160]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 19 11:50:23 staging nginx[2160]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 19 11:50:24 staging nginx[2160]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 19 11:50:24 staging nginx[2160]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 19 11:50:25 staging nginx[2160]: nginx: [emerg] still could not bind()
Jun 19 11:50:25 staging systemd[1]: nginx.service: Control process exited, code=exited status=1
Jun 19 11:50:25 staging systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Jun 19 11:50:25 staging systemd[1]: nginx.service: Unit entered failed state.
Jun 19 11:50:25 staging systemd[1]: nginx.service: Failed with result 'exit-code'.

이것이 무엇을 의미하는지, 어떻게 해결해야 하는지 모르겠습니다. systemctl솔직히, 나는 그것이 무엇인지조차 모릅니다. 나는 이것이 일종의 서비스 인터페이스라고 생각하지만 실제로는 모르겠습니다. 스테이징 서버를 설정할 때 방금 설치되었습니다.

답변1

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

이는 포트 80에서 수신 대기 중인 실행 중인 데몬이 여전히 있음을 의미합니다. 당신은 그것을 사용할 수 있습니다

lsof -i :80

그것이 무엇인지 알아보세요. 중지한 후 nginx서비스를 시작할 수 있습니다.

관련 정보