Install nginx in CentOS and upgrade nginx to the latest version.
Centos6.5
[Html] view plaincopy
- Select the fastest source for Automatic Installation
- [Root @ localhost ~] # Yuminstallyum-fastestmirror
I have installed it here, and the running result is as follows:
[Html] view plaincopy
- Loadedplugins: fastestmirror, refresh-packagekit, security
- Loadingtransferspeedsfromcachedhostfile
- * Base: ftp.riken.jp
- * Epel: mirrors.zju.edu.cn
- * Extras: ftp.riken.jp
- * Updates: ftp.riken.jp
- SettingupInstallProcess
- Packageyum-plugin-fastestmirror-1.1.30-30.el6.noarchalreadyinstalledandlatestversion
Install nginx
Yum install nginx
[Html] view plaincopy
- [Root @ localhost ~] # Yuminstallnginx
- Loadedplugins: fastestmirror, refresh-packagekit, security
- Loadingtransferspeedsfromcachedhostfile
- * Base: ftp.riken.jp
- * Epel: mirrors.opencas.cn
- * Extras: ftp.riken.jp
- * Updates: ftp.riken.jp
- SettingupInstallProcess
- Packagenginx-1.8.0-1.el6.ngx.x86_64alreadyinstalledandlatestversion
Smooth upgrade
Yum update nginx
Configure the nginx Source
[Html] view plaincopy
- [Root @ localhost ~] # Vim/etc/yum. repos. d/nginx. repo
[Html] view plaincopy
- # Nginx. repo
- [Nginx]
- Name = nginxrepo
- Baseurl = http://nginx.org/packages/centos/6/?basearch/
- Gpgcheck = 0
- Enabled = 1
[Html] view plaincopy
- </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
- [Root @ localhost ~] # Yumupdatenginx
- Loadedplugins: fastestmirror, refresh-packagekit, security
- Loadingtransferspeedsfromcachedhostfile
- * Base: ftp.riken.jp
- * Epel: ftp.cuhk.edu.hk
- * Extras: ftp.riken.jp
- * Updates: ftp.riken.jp
- Nginx | 2.9kB00: 00
- Nginx/primary_db | 37kB00: 00
- Settingupdateprocess
- ResolvingDependencies
- --> Runningtransactioncheck
- ---> Packagenginx. x86_640: 1.0.15-11. el6willbeupdated
- ---> Packagenginx. x86_640: 1.8.0-1. el6.ngxwillbeanupdate
- --> FinishedDependencyResolution
- DependenciesResolved
- ========================================================== ========================================================== ========================================================== ========================================================== ======================================
- PackageArchVersionRepositorySize
- ========================================================== ========================================================== ========================================================== ========================================================== ======================================
- Updating:
- Nginxx86_641.8.0-1.el6.ngxnginx352k
- TransactionSummary
- ========================================================== ========================================================== ========================================================== ========================================================== ======================================
- Upgrade1Package (s)
- Totaldownloadsize: 352 k
- Isthisok [y/N]: y
- DownloadingPackages:
- Nginx-1.8.0-1.el6.ngx.x86_64.rpm | 352kB00: 03
- Runningrpm_check_debug
- RunningTransactionTest
- TransactionTestSucceeded
- RunningTransaction
- Updating: nginx-1.8.0-1.el6.ngx.x86_641/2
- Cleanup: nginx-1.0.15-11.el6.x86_642/2
- Verifying: nginx-1.8.0-1.el6.ngx.x86_641/2
- Verifying: nginx-1.0.15-11.el6.x86_642/2
- Updated:
- Nginx. x86_640: 1.8.0-1. el6.ngx
- Complete!
- [Root @ localhost ~] # Servicenginxstop
- Stop nginx: [OK]
- [Root @ localhost ~] # Servicenginxstart
- Starting nginx: [OK]
- [Root @ localhost ~] # Nginx-v
- Nginxversion: nginx/1.8.0
The current nginx version is 1.8.0 (nginx-v)
The nginx access result is as follows: