Impossible de démarrer nginx

Bonjour,

Je suis en train de réinstaller une nouvelle instance yunohost chez moi et pour le moment il est dans ma chambre donc je l’eteint tous les soirs pour ne pas être déranger la nuit.

Sauf qu’une fois sur 2 lors de l’allumage de mon serveur, le service ngonx ne veut pas se relancer.

Jusqu’à maintenant je m’en sortait en redémarrant le pc ou avec un sudo yunohost service restart nginx
mais aujourd’hui rien ne fonctionne…

Voila ce que j’ai comme erreur :

admin@cbft:~$ sudo service nginx status
● 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 Sat 2019-05-18 10:06:08 CEST; 5min ago
Docs: man:nginx(8)
Process: 2838 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 2836 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
CPU: 113ms
mai 18 10:06:07 cbft.fr nginx[2838]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:07 cbft.fr nginx[2838]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:07 cbft.fr nginx[2838]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:08 cbft.fr nginx[2838]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:08 cbft.fr nginx[2838]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:08 cbft.fr nginx[2838]: nginx: [emerg] still could not bind()
mai 18 10:06:08 cbft.fr systemd[1]: nginx.service: Control process exited, code=exited status=1
mai 18 10:06:08 cbft.fr systemd[1]: Failed to start A high performance web server and a reverse proxy server.
mai 18 10:06:08 cbft.fr systemd[1]: nginx.service: Unit entered failed state.
mai 18 10:06:08 cbft.fr systemd[1]: nginx.service: Failed with result ‘exit-code’.

admin@cbft:~$ sudo nginx -t
nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

admin@cbft:~$ sudo yunohost service 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.
Attention : Impossible d’exécuter la commande ‘systemctl start nginx’
Erreur : Impossible de démarrer le service ‘nginx’
Journaux historisés récents : – Logs begin at Sat 2019-05-18 10:01:57 CEST, end at Sat 2019-05-18 10:06:08 CEST. –
mai 18 10:02:05 cbft.fr systemd[1]: Starting A high performance web server and a reverse proxy server…
– Subject: L’unité (unit) nginx.service a commencé à démarrer
– Defined-By: systemd
– Support: Debian -- User Support

– L’unité (unit) nginx.service a commencé à démarrer.
mai 18 10:02:46 cbft.fr nginx[501]: nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
mai 18 10:02:46 cbft.fr nginx[501]: nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
mai 18 10:02:55 cbft.fr nginx[1699]: nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
mai 18 10:02:55 cbft.fr nginx[1699]: nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
mai 18 10:02:55 cbft.fr nginx[1699]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:02:55 cbft.fr nginx[1699]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:02:56 cbft.fr nginx[1699]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:02:56 cbft.fr nginx[1699]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:02:56 cbft.fr nginx[1699]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:02:56 cbft.fr nginx[1699]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:02:57 cbft.fr nginx[1699]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:02:57 cbft.fr nginx[1699]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:02:57 cbft.fr nginx[1699]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:02:57 cbft.fr nginx[1699]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:02:58 cbft.fr nginx[1699]: nginx: [emerg] still could not bind()
mai 18 10:02:58 cbft.fr systemd[1]: nginx.service: Control process exited, code=exited status=1
mai 18 10:02:58 cbft.fr systemd[1]: Failed to start A high performance web server and a reverse proxy server.
– Subject: L’unité (unit) nginx.service a échoué
– Defined-By: systemd
– Support: Debian -- User Support

– L’unité (unit) nginx.service a échoué, avec le résultat failed.
mai 18 10:02:58 cbft.fr systemd[1]: nginx.service: Unit entered failed state.
mai 18 10:02:58 cbft.fr systemd[1]: nginx.service: Failed with result ‘exit-code’.
mai 18 10:06:06 cbft.fr systemd[1]: Starting A high performance web server and a reverse proxy server…
– Subject: L’unité (unit) nginx.service a commencé à démarrer
– Defined-By: systemd
– Support: Debian -- User Support

– L’unité (unit) nginx.service a commencé à démarrer.
mai 18 10:06:06 cbft.fr nginx[2836]: nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
mai 18 10:06:06 cbft.fr nginx[2838]: nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
mai 18 10:06:06 cbft.fr nginx[2838]: nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
mai 18 10:06:06 cbft.fr nginx[2838]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:06 cbft.fr nginx[2838]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:06 cbft.fr nginx[2838]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:06 cbft.fr nginx[2838]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:07 cbft.fr nginx[2838]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:07 cbft.fr nginx[2838]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:07 cbft.fr nginx[2838]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:07 cbft.fr nginx[2838]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:08 cbft.fr nginx[2838]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:08 cbft.fr nginx[2838]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
mai 18 10:06:08 cbft.fr nginx[2838]: nginx: [emerg] still could not bind()
mai 18 10:06:08 cbft.fr systemd[1]: nginx.service: Control process exited, code=exited status=1
mai 18 10:06:08 cbft.fr systemd[1]: Failed to start A high performance web server and a reverse proxy server.
– Subject: L’unité (unit) nginx.service a échoué
– Defined-By: systemd
– Support: Debian -- User Support

– L’unité (unit) nginx.service a échoué, avec le résultat failed.
mai 18 10:06:08 cbft.fr systemd[1]: nginx.service: Unit entered failed state.
mai 18 10:06:08 cbft.fr systemd[1]: nginx.service: Failed with result ‘exit-code’.

Est ce que quelqu’un aurait une autre manip pour redemarrer le service nginx ?

Merci

Yunohost version 3.5.5
installé sur un ordinateur chez moi

Ca ressemble a une situation ou un autre serveur web utilise deja le port 80 … Est-ce que tu n’aurais pas installé Apache par exemple ?

Sinon, que raconte un netstat -tulpn | grep LISTEN | grep 80

SI je teste ta commande j’ai :
-bash: netstat : commande introuvable

Je n’ai pas installé apache volontairement mais il me semble qu’il est présent…

Tu peux tenter de l’installer avec apt install net-tools -y ?

(On est d’accord, c’est pas super intuitif :wink: )

admin@cbft:~$ sudo netstat -tulpn | grep LISTEN | grep 80
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 1980/master
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1484/nginx: master
tcp 0 0 0.0.0.0:8083 0.0.0.0:* LISTEN 473/python
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1980/master
tcp6 0 0 :::587 :::* LISTEN 1980/master
tcp6 0 0 :::80 :::* LISTEN 1484/nginx: master
tcp6 0 0 :::25 :::* LISTEN 1980/master
tcp6 0 0 :::9980 :::* LISTEN 483/loolwsd

Mouarf …

et si tu fais un ps -ef --forest | grep -B5 nginx ?

admin@cbft:~$ ps -ef --forest | grep -B5 nginx
root 629 1 0 12:49 ? 00:00:00 /usr/sbin/sshd -D
root 31402 629 0 15:34 ? 00:00:00 _ sshd: admin [priv]
admin 31416 31402 0 15:34 ? 00:00:00 _ sshd: admin@pts/0
admin 31418 31416 0 15:34 pts/0 00:00:00 _ -bash
admin 9493 31418 0 16:04 pts/0 00:00:00 _ ps -ef --forest
admin 9494 31418 0 16:04 pts/0 00:00:00 _ grep -B5 nginx

root 1090 1 0 12:50 ? 00:00:00 /sbin/dhclient -4 -v -pf /run/dhclient.enp2s0.pid -lf /var/lib/dhcp/dhclient.enp2s0.leases -I -df /var/lib/dhcp/dhclient6.enp2s0.leases enp2s0
nslcd 1179 1 0 12:50 ? 00:00:00 /usr/sbin/nslcd
root 1257 1 0 12:50 ? 00:00:00 /usr/sbin/cron -f
daemon 1388 1 0 12:50 ? 00:00:00 /usr/sbin/atd -f
root 1448 1 0 12:50 ? 00:00:00 /usr/sbin/automount --pid-file /var/run/autofs.pid
root 1484 1 0 12:50 ? 00:00:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 22969 1484 0 14:32 ? 00:00:20 _ nginx: worker process
www-data 22970 1484 0 14:32 ? 00:00:15 _ nginx: worker process

Pour info j’ai réussi à redemarrer nginx après de nombreux essai de restart mais j’aimerai bien comprendre pour les prochaines fois.

Ah ben si le probleme a de nouveau ete resolu ca sert a rien d’investiguer en l’etat …

Mais comme dit, ce que tes logs initiaux montrent, c’est qu’il y avait un autre programme qui ecoutait deja sur le port 80 … Il y peux y avoir plein de raison derriere ca…

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.