Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I had nginx 0.8.54 installed on my Ubuntu 10.10 dev machine with php fastcgi all set up and working.

I wanted to start doing some Rails dev so I tried to install Passenger into my existing nginx install. Now everything seems all mixed up. My /sites-available/default config does not seem to be working in that I can't browse the dev sites I had previously set up.

When I run nginx -v at the terminal it says 0.8.54 but when I browse to say http://localhost/xyz it returns a 404 and the 404 error page indicates 0.8.53.

Also, if I run service nginx restart I get the following:

Restarting nginx: [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) [emerg]: still could not bind() nginx.

It seems like I have two versions of nginx running. Is that possible? How can I fix this so I have 1 version with php fastcgi and Rails/Passenger running?

share|improve this question

1 Answer 1

maybe you installed two versions of nginx:

# whereis nginx
nginx: /usr/sbin/nginx /etc/nginx /usr/local/sbin/nginx /usr/share/man/man1/nginx.1.gz
# nginx -V
nginx version: nginx/0.8.54
# /usr/sbin/nginx -V
nginx version: nginx/0.7.67

pathname expansion nginx to "/usr/local/sbin/nginx", because PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games(/usr/local/sbin before /usr/sbin).

Also try use find:

# find / -name nginx -executable -type f
/usr/sbin/nginx
/usr/local/sbin/nginx
/etc/init.d/nginx
share|improve this answer
    
using find it looks like I do in fact have 2 versions, 1 in /usr/sbin/nginx and 1 in /etc/nginx/sbin/nginx - how can I remove a specific one? –  brendan Mar 2 '11 at 2:46
    
"apt-get remove nginx" delete /usr/sbin/nginx –  ooshro Mar 2 '11 at 4:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.