nginx.service: Failed with result 'exit-code'.

rekoo20

New member
Joined
Feb 6, 2023
Messages
5
after updating DA my nginx stopped working and I'm getting these errors :
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.
systemctl status nginx.service :
nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/etc/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2023-02-24 01:17:18 CET; 17s ago
Process: 57682 ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
CPU: 56ms

Feb 24 01:17:18 master.domain.com systemd[1]: Starting The nginx HTTP and reverse proxy server...
Feb 24 01:17:18 master.domain.com nginx[57682]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Feb 24 01:17:18 master.domain.com nginx[57682]: nginx: [emerg] bind() to [::1]:80 failed (99: Cannot assign requested address)
Feb 24 01:17:18 master.domain.com nginx[57682]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 24 01:17:18 master.domain.com systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Feb 24 01:17:18 master.domain.com systemd[1]: nginx.service: Failed with result 'exit-code'.
Feb 24 01:17:18 master.domain.com systemd[1]: Failed to start The nginx HTTP and reverse proxy server.

journalctl -xeu nginx.service :
Feb 24 01:18:18 master.domain.com systemd[1]: nginx.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://access.redhat.com/support
░░
░░ The unit nginx.service has entered the 'failed' state with result 'exit-code'.
Feb 24 01:18:18 master.domain.com systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
░░ Subject: A start job for unit nginx.service has failed
░░ Defined-By: systemd
░░ Support: https://access.redhat.com/support
░░
░░ A start job for unit nginx.service has finished with a failure.
░░
░░ The job identifier is 4940 and the job result is failed.
Feb 24 01:19:12 master.domain.com systemd[1]: Starting The nginx HTTP and reverse proxy server...
░░ Subject: A start job for unit nginx.service has begun execution
░░ Defined-By: systemd
░░ Support: https://access.redhat.com/support
░░
░░ A start job for unit nginx.service has begun execution.
░░
░░ The job identifier is 5006.
Feb 24 01:19:12 master.domain.com nginx[57752]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Feb 24 01:19:12 master.domain.com nginx[57752]: nginx: [emerg] bind() to [::1]:80 failed (99: Cannot assign requested address)
Feb 24 01:19:12 master.domain.com nginx[57752]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 24 01:19:12 master.domain.com systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://access.redhat.com/support
░░
░░ An ExecStartPre= process belonging to unit nginx.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Feb 24 01:19:12 master.domain.com systemd[1]: nginx.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://access.redhat.com/support
░░
░░ The unit nginx.service has entered the 'failed' state with result 'exit-code'.
Feb 24 01:19:12 master.domain.com systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
░░ Subject: A start job for unit nginx.service has failed
░░ Defined-By: systemd
░░ Support: https://access.redhat.com/support
░░
░░ A start job for unit nginx.service has finished with a failure.
░░
░░ The job identifier is 5006 and the job result is failed.

====================================
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] bind() to [::1]:80 failed (99: Cannot assign requested address)
nginx: configuration file /etc/nginx/nginx.conf test failed
[root@master custombuild]#

==================
looked in some posts and there was something using port 80 .. but in my case, I don't even see port 80 in the list .

netstat -tpln

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 207.180.228.133:53 0.0.0.0:* LISTEN 1959/named
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 642/mysqld
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 602/pure-ftpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 598/sshd: /usr/sbin
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 589/exim
tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN 588/dovecot
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 588/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 588/dovecot
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 589/exim
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 589/exim
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 588/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 588/dovecot
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1959/named
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1959/named
tcp6 0 0 :::2222 :::* LISTEN 726/directadmin
tcp6 0 0 :::3306 :::* LISTEN 642/mysqld
tcp6 0 0 :::8080 :::* LISTEN 53492/httpd
tcp6 0 0 :::8081 :::* LISTEN 53492/httpd
tcp6 0 0 :::21 :::* LISTEN 602/pure-ftpd
tcp6 0 0 :::22 :::* LISTEN 598/sshd: /usr/sbin
tcp6 0 0 :::25 :::* LISTEN 589/exim
tcp6 0 0 :::4190 :::* LISTEN 588/dovecot
tcp6 0 0 :::110 :::* LISTEN 588/dovecot
tcp6 0 0 :::143 :::* LISTEN 588/dovecot
tcp6 0 0 :::465 :::* LISTEN 589/exim
tcp6 0 0 :::587 :::* LISTEN 589/exim
tcp6 0 0 :::993 :::* LISTEN 588/dovecot
tcp6 0 0 :::995 :::* LISTEN 588/dovecot
tcp6 0 0 fe80::250:56ff:fe49::53 :::* LISTEN 1959/named

==========

(( sry I'm a beginner (copy paste commands only:geek: ))
 
Hello,

Your nginx tries to bind to IPv6 address. If you don't have IPv6 on your server, then you might disable it in DirectAdmin settings:

Code:
/usr/local/directadmin/directadmin set ipv6 0 restart
/usr/local/directadmin/custombuild/build rewrite_confs
 
Hello,

Your nginx tries to bind to IPv6 address. If you don't have IPv6 on your server, then you might disable it in DirectAdmin settings:

Code:
/usr/local/directadmin/directadmin set ipv6 0 restart
/usr/local/directadmin/custombuild/build rewrite_confs
Using putty root user
-bash: usr/local/directadmin/directadmin: No such file or directory
[root@master ~]#

(I'm using Almalinux9)
 
Back
Top