Error on Nginx start

guidomallee

Verified User
Joined
Jun 7, 2013
Messages
15
I have installed nginx (and php-fpm) with custombuid 2.0. After the build I receive an error when trying to start nginx:

Code:
root@server1:/etc/nginx# /etc/init.d/nginx start
Starting nginx: nginx: [emerg] bind() to MY_IP:80 failed (99: Cannot assign requested address)
Any clues? Thanks!
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,483
Location
LT, EU
Please check if that IP is available in the output of ifconfig.
 

guidomallee

Verified User
Joined
Jun 7, 2013
Messages
15
MY_IP is not stated in the output. A different IP address is. The IP address that is shown is the actual IP address of the server where MY_IP isn't, I realize now. Could this have anything to do with the fact that I'm on a VPS?
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,483
Location
LT, EU
Please try:
Code:
/usr/local/directadmin/scripts/startips
/etc/init.d/nginx start
If it does not help, please check the assigned IPs for users in DA control panel, they all must exist on the system.
 

guidomallee

Verified User
Joined
Jun 7, 2013
Messages
15
That didn't work. I added the MY_IP IP address in the DirectAdmin Control Panel IP Management section. When I try to start nginx now I get the following output, where MY_REAL_IP is the IP assigned to my VPS and OTHER_IP the one that I first thought was my VPS IP (called MY_IP before):

Code:
Starting nginx: nginx: [emerg] bind() to OTHER_IP:80 failed (98: Address already in use)
nginx: [emerg] bind() to MY_REAL_IP:80 failed (98: Address already in use)
nginx: [emerg] bind() to OTHER_IP:443 failed (98: Address already in use)
nginx: [emerg] bind() to OTHER_IP:80 failed (98: Address already in use)
nginx: [emerg] bind() to MY_REAL_IP:80 failed (98: Address already in use)
nginx: [emerg] bind() to OTHER_IP:443 failed (98: Address already in use)
nginx: [emerg] bind() to OTHER_IP:80 failed (98: Address already in use)
nginx: [emerg] bind() to MY_REAL_IP:80 failed (98: Address already in use)
nginx: [emerg] bind() to OTHER_IP:443 failed (98: Address already in use)
nginx: [emerg] bind() to OTHER_IP:80 failed (98: Address already in use)
nginx: [emerg] bind() to MY_REAL_IP:80 failed (98: Address already in use)
nginx: [emerg] bind() to OTHER_IP:443 failed (98: Address already in use)
nginx: [emerg] bind() to OTHER_IP:80 failed (98: Address already in use)
nginx: [emerg] bind() to MY_REAL_IP:80 failed (98: Address already in use)
nginx: [emerg] bind() to OTHER_IP:443 failed (98: Address already in use)
nginx: [emerg] still could not bind()
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,483
Location
LT, EU
Please post the output of:
Code:
netstat -lnp | grep ':80'
It looks like apache is still running on ports 80 and 443.
 

guidomallee

Verified User
Joined
Jun 7, 2013
Messages
15
Code:
root@server1:/# netstat -lnp | grep ':80'
tcp6       0      0 :::80                   :::*                    LISTEN      1177/httpd
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,483
Location
LT, EU
Code:
root@server1:/# netstat -lnp | grep ':80'
tcp6       0      0 :::80                   :::*                    LISTEN      1177/httpd
Please try "./build nginx" again. That should help. Now you still have apache running on the system (you can kill/stop it manually and start nginx, but probably you missed some steps of nginx installation, that's why I recommended to run "./build nginx").
 
Top