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?

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
  • 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

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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