Advertisement
niammuddin

Upgrade Nginx Latest Version

Dec 30th, 2013
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. sudo nano /etc/apt/sources.list
  2.  
  3.  
  4.  
  5. Add the following in the file:
  6.  
  7. # Nginx upgrades
  8.  
  9. deb http://nginx.org/packages/ubuntu/ precise nginx
  10. deb-src http://nginx.org/packages/ubuntu/ precise nginx
  11.  
  12.  
  13.  
  14. Now remove the old version on your server:
  15.  
  16. sudo apt-get clean
  17.  
  18. sudo apt-get remove nginx-*
  19.  
  20.  
  21.  
  22. Get the signing key
  23.  
  24. wget http://nginx.org/packages/keys/nginx_signing.key
  25.  
  26. cat nginx_signing.key | sudo apt-key add -
  27.  
  28.  
  29.  
  30. And install the latest stable release, hit enter for the default which is to keep your nginx.conf and not install a new one.
  31.  
  32. sudo apt-get update
  33.  
  34. sudo apt-get upgrade
  35.  
  36. sudo apt-get install nginx
  37.  
  38.  
  39.  
  40. This will remove the old version but keep all your config and vhost files intact, install the latest stable release all without a seconds downtime
  41.  
  42.  
  43.  
  44. Now restart nginx
  45.  
  46. sudo service nginx restart
  47.  
  48.  
  49.  
  50. Enjoy!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement