Nginx restart problem

rpr

Verified User
Joined
Oct 20, 2010
Messages
65
Hi,

When I restart nginx I get these errors:
Code:
service nginx restart
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Shutting down nginx: nginx: [alert] kill(3825, 15) failed (3: No such process)

Starting nginx: nginx: [emerg] bind() to 185.59.17.146:80 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.135:80 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:80 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.146:443 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.135:443 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:443 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.146:80 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.135:80 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:80 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.146:443 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.135:443 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:443 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.146:80 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.135:80 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:80 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.146:443 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.135:443 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:443 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.146:80 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.135:80 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:80 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.146:443 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.135:443 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:443 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.146:80 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.135:80 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:80 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.146:443 failed (98: Address already in use)
nginx: [emerg] bind() to 185.59.17.135:443 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:443 failed (98: Address already in use)
nginx: [emerg] still could not bind()

When the first time after reboot I get this:
Code:
service nginx restart
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Shutting down nginx:
Starting nginx:

I don't find the reason why the error shows up. Anyone has some pointers to find the reason?
 
Please make sure no other webserver is running on Nginx ports. The following command should show it for you:
Code:
lsof -i | grep ':http'

To install lsof, if it's not installed on your system yet:
Code:
yum -y install lsof
 
What I see using the command:
Code:
lsof -i | grep ':http'
nginx     2901    nginx   24u  IPv4   8650      0t0  TCP ************************:http (LISTEN)
nginx     2901    nginx   25u  IPv4   8651      0t0  TCP vs-da-01.************************:http (LISTEN)
nginx     2901    nginx   26u  IPv4   8652      0t0  TCP localhost:http (LISTEN)
nginx     2901    nginx   27u  IPv4   8653      0t0  TCP ************************:https (LISTEN)
nginx     2901    nginx   28u  IPv4   8654      0t0  TCP vs-da-01.************************:https (LISTEN)
nginx     2901    nginx   29u  IPv4   8655      0t0  TCP localhost:https (LISTEN)
nginx     2902    nginx   24u  IPv4   8650      0t0  TCP ************************:http (LISTEN)
nginx     2902    nginx   25u  IPv4   8651      0t0  TCP vs-da-01.************************:http (LISTEN)
nginx     2902    nginx   26u  IPv4   8652      0t0  TCP localhost:http (LISTEN)
nginx     2902    nginx   27u  IPv4   8653      0t0  TCP ************************:https (LISTEN)
nginx     2902    nginx   28u  IPv4   8654      0t0  TCP vs-da-01.************************:https (LISTEN)
nginx     2902    nginx   29u  IPv4   8655      0t0  TCP localhost:https (LISTEN)
nginx     2903    nginx   24u  IPv4   8650      0t0  TCP ************************:http (LISTEN)
nginx     2903    nginx   25u  IPv4   8651      0t0  TCP vs-da-01.************************:http (LISTEN)
nginx     2903    nginx   26u  IPv4   8652      0t0  TCP localhost:http (LISTEN)
nginx     2903    nginx   27u  IPv4   8653      0t0  TCP ************************:https (LISTEN)
nginx     2903    nginx   28u  IPv4   8654      0t0  TCP vs-da-01.************************:https (LISTEN)
nginx     2903    nginx   29u  IPv4   8655      0t0  TCP localhost:https (LISTEN)
nginx     2904    nginx   24u  IPv4   8650      0t0  TCP ************************:http (LISTEN)
nginx     2904    nginx   25u  IPv4   8651      0t0  TCP vs-da-01.************************:http (LISTEN)
nginx     2904    nginx   26u  IPv4   8652      0t0  TCP localhost:http (LISTEN)
nginx     2904    nginx   27u  IPv4   8653      0t0  TCP ************************:https (LISTEN)
nginx     2904    nginx   28u  IPv4   8654      0t0  TCP vs-da-01.************************:https (LISTEN)
nginx     2904    nginx   29u  IPv4   8655      0t0  TCP localhost:https (LISTEN)
 
Found the problem.
Everything is running smooth until I see this in the syslog:
Code:
Mar 18 23:27:01 vs-da-01 kernel: [21960.837262] nginx[13107]: segfault at 0 ip 00000000004112e8 sp 00007ffd09c28888 error 4 in nginx[400000+95f000]
 
Back
Top