Install nginx in CentOS and upgrade nginx to the latest version.

Source: Internet
Author: User

Install nginx in CentOS and upgrade nginx to the latest version.

Centos6.5

[Html] view plaincopy
  1. Select the fastest source for Automatic Installation
  2. [Root @ localhost ~] # Yuminstallyum-fastestmirror
I have installed it here, and the running result is as follows:

[Html] view plaincopy
  1. Loadedplugins: fastestmirror, refresh-packagekit, security
  2. Loadingtransferspeedsfromcachedhostfile
  3. * Base: ftp.riken.jp
  4. * Epel: mirrors.zju.edu.cn
  5. * Extras: ftp.riken.jp
  6. * Updates: ftp.riken.jp
  7. SettingupInstallProcess
  8. Packageyum-plugin-fastestmirror-1.1.30-30.el6.noarchalreadyinstalledandlatestversion

Install nginx

Yum install nginx

[Html] view plaincopy
  1. [Root @ localhost ~] # Yuminstallnginx
  2. Loadedplugins: fastestmirror, refresh-packagekit, security
  3. Loadingtransferspeedsfromcachedhostfile
  4. * Base: ftp.riken.jp
  5. * Epel: mirrors.opencas.cn
  6. * Extras: ftp.riken.jp
  7. * Updates: ftp.riken.jp
  8. SettingupInstallProcess
  9. Packagenginx-1.8.0-1.el6.ngx.x86_64alreadyinstalledandlatestversion

Smooth upgrade

Yum update nginx

Configure the nginx Source

[Html] view plaincopy
  1. [Root @ localhost ~] # Vim/etc/yum. repos. d/nginx. repo

[Html] view plaincopy
  1. # Nginx. repo
  2. [Nginx]
  3. Name = nginxrepo
  4. Baseurl = http://nginx.org/packages/centos/6/?basearch/
  5. Gpgcheck = 0
  6. Enabled = 1
[Html] view plaincopy
  1. </Pre> <precode_snippet_id = "659047" snippet_file_name = "blog_20150505_7_9989798" name = "code" class = "html"> yumupdateng.pdf

The execution result and check are as follows:

[Html] view plaincopy
  1. [Root @ localhost ~] # Yumupdatenginx
  2. Loadedplugins: fastestmirror, refresh-packagekit, security
  3. Loadingtransferspeedsfromcachedhostfile
  4. * Base: ftp.riken.jp
  5. * Epel: ftp.cuhk.edu.hk
  6. * Extras: ftp.riken.jp
  7. * Updates: ftp.riken.jp
  8. Nginx | 2.9kB00: 00
  9. Nginx/primary_db | 37kB00: 00
  10. Settingupdateprocess
  11. ResolvingDependencies
  12. --> Runningtransactioncheck
  13. ---> Packagenginx. x86_640: 1.0.15-11. el6willbeupdated
  14. ---> Packagenginx. x86_640: 1.8.0-1. el6.ngxwillbeanupdate
  15. --> FinishedDependencyResolution
  16. DependenciesResolved
  17. ========================================================== ========================================================== ========================================================== ========================================================== ======================================
  18. PackageArchVersionRepositorySize
  19. ========================================================== ========================================================== ========================================================== ========================================================== ======================================
  20. Updating:
  21. Nginxx86_641.8.0-1.el6.ngxnginx352k
  22. TransactionSummary
  23. ========================================================== ========================================================== ========================================================== ========================================================== ======================================
  24. Upgrade1Package (s)
  25. Totaldownloadsize: 352 k
  26. Isthisok [y/N]: y
  27. DownloadingPackages:
  28. Nginx-1.8.0-1.el6.ngx.x86_64.rpm | 352kB00: 03
  29. Runningrpm_check_debug
  30. RunningTransactionTest
  31. TransactionTestSucceeded
  32. RunningTransaction
  33. Updating: nginx-1.8.0-1.el6.ngx.x86_641/2
  34. Cleanup: nginx-1.0.15-11.el6.x86_642/2
  35. Verifying: nginx-1.8.0-1.el6.ngx.x86_641/2
  36. Verifying: nginx-1.0.15-11.el6.x86_642/2
  37. Updated:
  38. Nginx. x86_640: 1.8.0-1. el6.ngx
  39. Complete!
  40. [Root @ localhost ~] # Servicenginxstop
  41. Stop nginx: [OK]
  42. [Root @ localhost ~] # Servicenginxstart
  43. Starting nginx: [OK]
  44. [Root @ localhost ~] # Nginx-v
  45. Nginxversion: nginx/1.8.0

The current nginx version is 1.8.0 (nginx-v)

The nginx access result is as follows:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.