Nginx won't update on Centos

I currently have nginx/0.6.39 on centos. I tried installing the latest version 0.7.6.5 on the server. When I check the version using nginx -v, it still shows the old version. But when I do -v on the sbin it shows the latest version. How can I fix this problem? Is my server successfully updated?

9 Replies

No your server isn't succesfully updated, I imagine you now have two copies of nginx.

Do a

whereis nginx

and it'll tell you where they are.

I assume you compiled the new version, if so find the old version's path (say it's /usr/sbin/nginx) then add –prefix=/usr to your configure line.

Yes, I compiled from source for the new nginx.

I did a whereis nginx and got this:

nginx: /usr/sbin/nginx /etc/nginx /usr/local/nginx /usr/share/nginx /usr/share/man/man3/nginx.3pm.gz

What should I do now?

I tried restarting but doesn't help

You need to specify your prefix when comiling to /usr

so it'll be

./configure –prefix=/usr

the default for nginx is /usr/local/nginx.

Cool now it works after i recompile. THank you! How can i print out the new nginx path? Do I need to remove the old nginx files?

You might as well remove the old files just do

rm -rf /usr/local/nginx

What do you mean by print out the new nginx path?

The binary will be installed in /usr/sbin/nginx

k done. I am now trying to add phpmyadmin to http://mywebsite.com/phpmyadmin but when I go to the url, I got the following error: "No input file specified. "

Any fix for it?

> location /phpmyadmin {

root /usr/share;

index index.php;

}

location ~ ^/phpmyadmin.+.php$ {

root /usr/share;

fastcgi_index index.php;

fastcgi_pass 127.0.0.1:9000;

fastcgiparam SCRIPTFILENAME /usr/share/phpmyadmin$fastcgiscriptname;

include fastcgi_params;

fastcgi_param HTTPS on;

}

location /phpMyAdmin {

rewrite ^/* /phpmyadmin last;

}

A quick google tells me that means php can't find the file you're trying to send to it (it's the equivalent of a 404 not found) so you're file paths are probably wrong. I personally don't use CentOS, or PHP FCGI so I'm not sure exactly what the issue is.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct