今天看啥
热点:

CentOS下安装nginx并且升级nginx到最新版


Centos6.5

[html]view plaincopy在CODE上查看代码片派生到我的代码片
  1. 自动安装选择最快的源
  2. [[email protected]~]#yuminstallyum-fastestmirror
这里我已经安装过,运行结果如下

[html]view plaincopy在CODE上查看代码片派生到我的代码片
  1. Loadedplugins:fastestmirror,refresh-packagekit,security
  2. Loadingmirrorspeedsfromcachedhostfile
  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

安装nginx

yum install nginx

[html]view plaincopy在CODE上查看代码片派生到我的代码片
  1. [[email protected]~]#yuminstallnginx
  2. Loadedplugins:fastestmirror,refresh-packagekit,security
  3. Loadingmirrorspeedsfromcachedhostfile
  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

平滑升级

yum update nginx

执行命令前,首先配置nginx 源

[html]view plaincopy在CODE上查看代码片派生到我的代码片
  1. [[email protected]~]#vim/etc/yum.repos.d/nginx.repo

[html]view plaincopy在CODE上查看代码片派生到我的代码片
  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在CODE上查看代码片派生到我的代码片
  1. </pre><precode_snippet_id="659047"snippet_file_name="blog_20150505_7_9989798"name="code"class="html">yumupdatenginx

执行结果与检查如下

[html]view plaincopy在CODE上查看代码片派生到我的代码片
  1. [[email protected]~]#yumupdatenginx
  2. Loadedplugins:fastestmirror,refresh-packagekit,security
  3. Loadingmirrorspeedsfromcachedhostfile
  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. SettingupUpdateProcess
  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:352k
  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. [[email protected]~]#servicenginxstop
  41. 停止nginx:[确定]
  42. [[email protected]~]#servicenginxstart
  43. 正在启动nginx:[确定]
  44. [[email protected]~]#nginx-v
  45. nginxversion:nginx/1.8.0

当前nginx版本为 1.8.0 (nginx -v)

nginx 访问结果如下图

www.bkjia.comtruehttp://www.bkjia.com/Linux/1000649.htmlTechArticleCentOS下安装nginx并且升级nginx到最新版 Centos6.5 [html]view plaincopy 自动安装选择最快的源 [[email protected]~]#yuminstallyum-fastestmirror 这里我已经安装过...

相关文章

帮客评论

视觉看点