web-dev-qa-db-fra.com

Impossible de redémarrer NGinx, "Emploi pour Nginx.Service a échoué car le processus de contrôle est sorti avec le code d'erreur".

J'ai une goutte digitalocean avec Ubuntu 16.04 en cours d'exécution. Je sert à la plupart des sites statiques avec Nginx, mais cela a soudainement cessé de fonctionner.

(Comme vous pourriez comprendre de cette intro, je suis tout à fait le débutant.)

J'ai essayé de redémarrer nginx :

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

SystemCtL Statut NGinx.Service :

$ 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 Thu 2019-04-25 12:31:46 UTC; 55s ago
     Docs: man:nginx(8)
  Process: 8232 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 8221 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

journalctl -xe

    $ Sudo journalctl -u nginx
    - Logs begin at Thu 2019-03-21 01:07:26 UTC, end at Thu 2019-04-25 12:54:26 UTC. --
Apr 25 10:33:29 ubuntu-s-michaelsimsoe systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 25 10:33:29 ubuntu-s-michaelsimsoe systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Apr 25 10:34:16 ubuntu-s-michaelsimsoe systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 25 10:34:17 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 10:34:17 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 10:34:18 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 10:34:18 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 10:34:18 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 10:34:18 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 10:34:19 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 10:34:19 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 10:34:19 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 10:34:19 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 10:34:20 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] still could not bind()
Apr 25 10:34:20 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 25 10:34:20 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 25 10:34:20 ubuntu-s-michaelsimsoe systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 25 12:08:48 ubuntu-s-michaelsimsoe systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 25 12:08:48 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:08:48 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:08:49 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:08:49 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:08:49 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:08:49 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:08:50 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:08:50 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:08:50 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:08:50 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:08:51 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] still could not bind()
Apr 25 12:08:51 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 25 12:08:51 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 25 12:08:51 ubuntu-s-michaelsimsoe systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 25 12:10:24 ubuntu-s-michaelsimsoe systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 25 12:10:25 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:10:25 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:10:25 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:10:25 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:10:26 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:10:26 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:10:26 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:10:26 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:10:27 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:10:27 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:10:27 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] still could not bind()
Apr 25 12:10:27 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 25 12:10:27 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 25 12:10:27 ubuntu-s-michaelsimsoe systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 25 12:12:59 ubuntu-s-michaelsimsoe systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 25 12:12:59 ubuntu-s-michaelsimsoe nginx[30965]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:12:59 ubuntu-s-michaelsimsoe nginx[30965]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:12:59 ubuntu-s-michaelsimsoe nginx[30965]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:12:59 ubuntu-s-michaelsimsoe nginx[30965]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:13:00 ubuntu-s-michaelsimsoe nginx[30965]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

Ce qui suit a été fait par moi avant que j'ai remarqué les erreurs: * Mot de passe racine modifié * Mot de passe modifié pour l'utilisateur Michaels * Changé de propriété des dossiers de site Web (j'essaie de configurer Webhooks)

Des pensées sur ce que cela pourrait être?

EDIT: quelques informations supplémentaires

$ Sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

$ ps -A | nginx
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2019/04/25 13:09:32 [warn] 28351#28351: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2019/04/25 13:09:32 [emerg] 28351#28351: BIO_new_file("/etc/letsencrypt/live/huske.michaelsimsoe.no/fullchain.pem") failed (SSL: error:0200100D:system library:fopen:Permission denied:fopen('/etc/letsencrypt/live/huske.michaelsimsoe.no/fullchain.pem','r') error:2006D002:BIO routines:BIO_new_file:system lib)

Avant d'installer Nginx, j'ai eu des pages de somme desservies par Apache. Je peux les atteindre encore.

Un autre processus est déjà exécuté et lié aux ports 80/443, donc SystemD ne peut pas démarrer NGinx. C'est presque toujours parce que le processus a été démarré manuellement au lieu de via SystemD, ou parce que vous avez essayé de démarrer deux serveurs Web différents en même temps.

Pour résoudre le problème, tuez-vous le processus vous-même avant de le redémarrer via SystemD.

Sudo killall Apache2
6
Michael Hampton