Error Plesk: 0.0.0.0:80 failed (98: Address already in use)
Después de toda actualización “gorda” de Plesk me llevo una sorpresa, normalmente no muy agradable. En este caso ha sido un cambio de versión que me ha dejado las webs fuera de servicio.
La gestión de plesk no ha dado ningún problema, de hecho el procedimiento es muy sencillo, pero como digo, mi servidor Centos daba errores por todos lados.
Lo primero que suelo hacer, porque siempre van por ahí los tiros, es comprobar los servicios MYSQL y NGINX.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
[root@servidor-1 ~]# systemctl status mysql.service ● mariadb.service - MariaDB 10.1.35 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: active (running) since Fri 2018-09-01 06:48:03 UTC; 4min 27s ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Process: 1159 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 796 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR=|| VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environmen t _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS) Process: 784 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Main PID: 845 (mysqld) Status: "Taking your SQL requests now..." CGroup: /system.slice/mariadb.service └─845 /usr/sbin/mysqld Aug 31 06:48:02 servidor-1.localdomain mysqld[845]: 2018-08-31 6:48:02 14065... Aug 31 06:48:02 servidor-1.localdomain mysqld[845]: 2018-08-31 6:48:02 14065... Aug 31 06:48:02 servidor-1.localdomain mysqld[845]: 2018-08-31 6:48:02 14065... Aug 31 06:48:02 servidor-1.localdomain mysqld[845]: 2018-08-31 6:48:02 14065... Aug 31 06:48:03 servidor-1.localdomain mysqld[845]: 2018-08-31 6:48:03 14065... Aug 31 06:48:03 servidor-1.localdomain mysqld[845]: 2018-08-31 6:48:03 14065... Aug 31 06:48:03 servidor-1.localdomain mysqld[845]: 2018-08-31 6:48:03 14065... Aug 31 06:48:03 servidor-1.localdomain mysqld[845]: 2018-08-31 6:48:03 14065... Aug 31 06:48:03 servidor-1.localdomain mysqld[845]: Version: '10.1.35-MariaDB... Aug 31 06:48:03 servidor-1.localdomain systemd[1]: Started MariaDB 10.1.35 da... Hint: Some lines were ellipsized, use -l to show in full. |
Y como no podía ser de otra forma, es NGINX el que me da el error. Ya comento que casi siempre es el problema. Quizás por mi integración con Varnish+Apache+Nginx+Mysql:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[root@servidor-1 ~]# systemctl status nginx.service ● nginx.service - Startup script for nginx service Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2018-08-31 06:52:40 UTC; 24s ago Process: 1522 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE) Process: 1519 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS) Process: 1517 ExecStartPre=/usr/bin/test $NGINX_ENABLED = yes (code=exited, status=0/SUCCESS) Aug 31 06:52:39 servidor-1.localdomain nginx[1522]: nginx: [emerg] bind() to 188.xxx.xxx.xxx:80 failed (98: Address already in use) Aug 31 06:52:39 servidor-1.localdomain nginx[1522]: nginx: [emerg] bind() to 149.xxx.xxx.xxx:80 failed (98: Address already in use) Aug 31 06:52:39 servidor-1.localdomain nginx[1522]: nginx: [emerg] bind() to 188.xxx.xxx.xxx:80 failed (98: Address already in use) Aug 31 06:52:40 servidor-1.localdomain nginx[1522]: nginx: [emerg] bind() to 149.xxx.xxx.xxx:80 failed (98: Address already in use) Aug 31 06:52:40 servidor-1.localdomain nginx[1522]: nginx: [emerg] bind() to 188.xxx.xxx.xxx:80 failed (98: Address already in use) Aug 31 06:52:40 servidor-1.localdomain nginx[1522]: nginx: [emerg] still could not bind() Aug 31 06:52:40 servidor-1.localdomain systemd[1]: nginx.service: control process exited, code=exited status=1 Aug 31 06:52:40 servidor-1.localdomain systemd[1]: Failed to start Startup script for nginx service. Aug 31 06:52:40 servidor-1.localdomain systemd[1]: Unit nginx.service entered failed state. Aug 31 06:52:40 servidor-1.localdomain systemd[1]: nginx.service failed. |
Parece que algo está utilizando el puerto 80 y 443 que NGINX debería utilizar. Así que reviso qué puede ser:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
[root@servidor-1 ~]# netstat -plunt Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program n ame tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1071/master tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 822/named tcp 0 0 127.0.0.1:12346 0.0.0.0:* LISTEN 1071/master tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 5353/sw-cp-se rver: tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN 985/dovecot tcp 0 0 127.0.0.1:12768 0.0.0.0:* LISTEN 783/psa-pc-re mote tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 985/dovecot tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN 922/varnishd tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 985/dovecot tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 985/dovecot tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 985/dovecot tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 13404/varnish d tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 5353/sw-cp-se rver: tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 1071/master tcp 0 0 188.xxx.xxx.xxx:53 0.0.0.0:* LISTEN 822/named tcp 0 0 149.xxx.xxx.xxx:53 0.0.0.0:* LISTEN 822/named tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 822/named tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 992/sshd tcp6 0 0 :::25 :::* LISTEN 1071/master tcp6 0 0 :::8443 :::* LISTEN 5353/sw-cp-se rver: tcp6 0 0 :::4190 :::* LISTEN 985/dovecot tcp6 0 0 :::993 :::* LISTEN 985/dovecot tcp6 0 0 :::995 :::* LISTEN 985/dovecot tcp6 0 0 :::7081 :::* LISTEN 17505/httpd tcp6 0 0 :::3306 :::* LISTEN 845/mysqld tcp6 0 0 :::106 :::* LISTEN 792/xinetd tcp6 0 0 :::110 :::* LISTEN 985/dovecot tcp6 0 0 :::143 :::* LISTEN 985/dovecot tcp6 0 0 :::8080 :::* LISTEN 17505/httpd tcp6 0 0 :::80 :::* LISTEN 13404/varnish d tcp6 0 0 :::8880 :::* LISTEN 5353/sw-cp-se rver: tcp6 0 0 :::465 :::* LISTEN 1071/master tcp6 0 0 :::53 :::* LISTEN 822/named tcp6 0 0 :::21 :::* LISTEN 792/xinetd tcp6 0 0 :::22 :::* LISTEN 992/sshd udp 0 0 188.xxx.xxx.xxx:53 0.0.0.0:* 822/named udp 0 0 149.xxx.xxx.xxx:53 0.0.0.0:* 822/named udp 0 0 127.0.0.1:53 0.0.0.0:* 822/named udp 0 0 0.0.0.0:68 0.0.0.0:* 689/dhclient udp6 0 0 :::53 :::* 822/named |
Matamos los procesos que interfieren con NGINX, en este caso VARNISH
1 2 3 4 |
[root@servidor-1 ~]# fuser -kivn tcp 80 USER PID ACCESS COMMAND 80/tcp: varnish 18837 F.... varnishd Kill process 18837 ? (y/N) y |
Y arrancamos los servicios nuevamente, esta vez sin problemas:
1 2 3 4 5 6 7 8 |
[root@servidor-1 ~]# service nginx start Starting nginx (via systemctl): [ OK ] [root@servidor-1 ~]# service varnish start Redirecting to /bin/systemctl start varnish.service [root@servidor-1 ~]# service httpd start Redirecting to /bin/systemctl start httpd.service |
Espero que os sirva como a mi esta solución.
Te ha gustado la entrada SGUENOS EN TWITTER O INVITANOS A UN CAFE?