{"id":42973,"date":"2016-10-27T18:40:02","date_gmt":"2016-10-27T10:40:02","guid":{"rendered":"http:\/\/www.jiloc.com\/?p=42973"},"modified":"2016-10-27T18:40:45","modified_gmt":"2016-10-27T10:40:45","slug":"centos%e9%85%8d%e7%bd%aenginx%e5%ae%98%e6%96%b9yum%e6%ba%90-%e8%bf%9b%e8%a1%8c%e5%ae%89%e8%a3%85-%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"http:\/\/jiloc.com\/42973.html","title":{"rendered":"CentOS\u914d\u7f6eNginx\u5b98\u65b9Yum\u6e90 \u8fdb\u884c\u5b89\u88c5 \u56fe\u6587\u6559\u7a0b"},"content":{"rendered":"

<\/p>\n

\u8fd9\u4e0d\u662f\u524d\u4e24\u5929\u5b50\u51e1\u641e\u4e86\u4e2a\u5c0f\u9e1f\u4e91\u7684\u514d\u8d39\u4e91\u4e3b\u673a\uff0c\u6b63\u51c6\u5907\u642d\u5efa\u4e2aWEB\u73af\u5883\u6765\u73a9\u73a9\uff0c\u7ed3\u679c\u76f4\u63a5\u4f7f\u7528\u201cyum -y install nginx\u201d\u5b89\u88c5\u624d\u53d1\u73b0\u9ed8\u8ba4yum\u4ed3\u5e93\u6ca1\u6709nginx\uff0c\u6240\u4ee5\u5c31\u65e0\u6cd5\u76f4\u63a5\u5b89\u88c5nginx\u4e86\uff0c\u6240\u4ee5\u4eca\u5929\u5c31\u548c\u5b50\u51e1\u4e00\u8d77\u6765\u7b80\u5355\u7684\u914d\u7f6e\u4e00\u4e0b\u5427\uff01<\/p>\n

\u7531\u4e8eyum\u6e90\u4e2d\u6ca1\u6709\u6211\u4eec\u60f3\u8981\u7684nginx\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u201c\/etc\/yum.repos.d\/nginx.repo\u201d\u7684\u6587\u4ef6\uff0c\u5176\u5b9e\u5c31\u662f\u65b0\u589e\u4e00\u4e2ayum\u6e90\u3002<\/p>\n

vi \/etc\/yum.repos.d\/nginx.repo<\/p><\/blockquote>\n

\u7136\u540e\u5c06\u4e0b\u9762\u7684\u5185\u5bb9\u590d\u5236\u8fdb\u53bb\uff1a<\/p>\n

[nginx]
\nname=nginx repo
\nbaseurl=http:\/\/nginx.org\/packages\/centos\/$releasever\/$basearch\/
\ngpgcheck=0
\nenabled=1<\/p><\/blockquote>\n

\u7136\u540e\u4fdd\u5b58\u201c\/etc\/yum.repos.d\/nginx.repo\u201d\u6587\u4ef6\u540e\uff0c\u6211\u4eec\u5c31\u4f7f\u7528yum\u547d\u4ee4\u67e5\u8be2\u4e00\u4e0b\u6211\u4eec\u7684nginx\u7684yum\u6e90\u914d\u7f6e\u597d\u4e86\u6ca1\u6709\u3002<\/p>\n

# yum list |grep nginx
\nnginx.x86_64 1:1.10.1-1.el7.ngx nginx
\nnginx-debug.x86_64 1:1.8.0-1.el7.ngx nginx
\nnginx-debuginfo.x86_64 1:1.10.1-1.el7.ngx nginx
\nnginx-module-geoip.x86_64 1:1.10.1-1.el7.ngx nginx
\nnginx-module-image-filter.x86_64 1:1.10.1-1.el7.ngx nginx
\nnginx-module-njs.x86_64 1:1.10.1.0.0.20160414.1c50334fbea6-1.el7.ngx
\nnginx
\nnginx-module-perl.x86_64 1:1.10.1-1.el7.ngx nginx
\nnginx-module-xslt.x86_64 1:1.10.1-1.el7.ngx nginx
\nnginx-nr-agent.noarch 2.0.0-9.el7.ngx nginx
\npcp-pmda-nginx.x86_64 3.10.6-2.el7 base<\/p><\/blockquote>\n

\u5982\u679c\u6267\u884c\u547d\u4ee4\u662f\u8fd9\u6837\u7684\u663e\u793a\u6548\u679c\uff0c\u90a3\u4e48\u6211\u4eec\u7684nginx\u7684yum\u6e90\u5c31\u914d\u7f6e\u6210\u529f\u5566\uff01<\/p>\n

\u7136\u540e\u8981\u5b89\u88c5\u6211\u4eec\u7684nginx\u5c31\u76f4\u63a5\u6267\u884c\uff1a<\/p>\n

yum -y install nginx<\/p><\/blockquote>\n

\u5982\u679c\u64cd\u4f5c\u6b63\u786e\u5230\u8fd9\u91ccnginx\u73af\u5883\u5c31\u5df2\u7ecf\u5b89\u88c5OK\u4e86\u3002<\/p>\n

\u5f53\u7136\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u67e5\u4e00\u4e0b\u7a76\u7adf\u662f\u5426\u5b89\u88c5\u5b8c\u6210\u3002<\/p>\n

# rpm -q nginx
\nnginx-1.10.1-1.el7.ngx.x86_64<\/p><\/blockquote>\n

\u4e0d\u89e3\u91ca\uff0c\u5df2\u7ecf\u6210\u529f\u4e86\uff0c\u5e76\u4e14\u662fnginx\u5b98\u65b9\u7684\u6700\u65b0\u7248\u672c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u8fd9\u4e0d\u662f\u524d\u4e24\u5929\u5b50\u51e1\u641e\u4e86\u4e2a\u5c0f\u9e1f\u4e91\u7684\u514d\u8d39\u4e91\u4e3b\u673a\uff0c\u6b63\u51c6\u5907\u642d\u5efa\u4e2aWEB\u73af\u5883\u6765\u73a9\u73a9\uff0c\u7ed3\u679c\u76f4\u63a5\u4f7f\u7528\u201cyum -y insta […]<\/p>\n","protected":false},"author":1,"featured_media":42976,"comment_status":"open","ping_status":"closed","sticky":false,"template":"single-with-sidebar","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[21,44,129,130,22,40,109],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/jiloc.com\/wp-json\/wp\/v2\/posts\/42973"}],"collection":[{"href":"http:\/\/jiloc.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/jiloc.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/jiloc.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/jiloc.com\/wp-json\/wp\/v2\/comments?post=42973"}],"version-history":[{"count":0,"href":"http:\/\/jiloc.com\/wp-json\/wp\/v2\/posts\/42973\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/jiloc.com\/wp-json\/wp\/v2\/media\/42976"}],"wp:attachment":[{"href":"http:\/\/jiloc.com\/wp-json\/wp\/v2\/media?parent=42973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/jiloc.com\/wp-json\/wp\/v2\/categories?post=42973"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/jiloc.com\/wp-json\/wp\/v2\/tags?post=42973"}],"curies":[{"name":"wp","href":"http:\/\/api.w.org\/{rel}","templated":true}]}}