{"id":398,"date":"2019-04-18T16:21:05","date_gmt":"2019-04-18T08:21:05","guid":{"rendered":"http:\/\/www.kejidana.com\/?p=398"},"modified":"2019-04-18T16:21:05","modified_gmt":"2019-04-18T08:21:05","slug":"centos6-9%e4%b8%8b%e7%94%a8yum%e5%ae%89%e8%a3%85nginx","status":"publish","type":"post","link":"http:\/\/www.kejidana.com\/?p=398","title":{"rendered":"CentOS6.9\u4e0b\u7528yum\u5b89\u88c5nginx"},"content":{"rendered":"<p>\u7b2c\u4e00\u6b65\uff0c\u5728\/etc\/yum.repos.d\/\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u6e90\u914d\u7f6e\u6587\u4ef6nginx.repo\uff1a<\/p>\n<p>cd \/etc\/yum.repos.d\/<\/p>\n<p>vim nginx.repo<br \/>\n\u586b\u5199\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<p>[nginx]<br \/>\nname=nginx repo<br \/>\nbaseurl=http:\/\/nginx.org\/packages\/centos\/6\/$basearch\/<br \/>\ngpgcheck=0<br \/>\nenabled=1<br \/>\n\u4fdd\u5b58\uff0c\u5219\u4f1a\u4ea7\u751f\u4e00\u4e2a\/etc\/yum.repos.d\/nginx.repo\u6587\u4ef6\u3002<\/p>\n<p>\u4e0b\u9762\u76f4\u63a5\u6267\u884c\u5982\u4e0b\u6307\u4ee4\u5373\u53ef\u81ea\u52a8\u5b89\u88c5\u597dNginx\uff1a<\/p>\n<p>yum install nginx -y<br \/>\n\u5b89\u88c5\u5b8c\u6210\uff0c\u4e0b\u9762\u76f4\u63a5\u5c31\u53ef\u4ee5\u542f\u52a8Nginx\u4e86\uff1a<\/p>\n<p>service nginx start<br \/>\n\u73b0\u5728Nginx\u5df2\u7ecf\u542f\u52a8\u4e86\uff0c\u76f4\u63a5\u8bbf\u95ee\u670d\u52a1\u5668\u5c31\u80fd\u770b\u5230Nginx\u6b22\u8fce\u9875\u9762\u4e86\u7684\u3002<\/p>\n<p>\u5982\u679c\u8fd8\u65e0\u6cd5\u8bbf\u95ee\uff0c\u5219\u9700\u914d\u7f6e\u4e00\u4e0bLinux\u9632\u706b\u5899\u3002<\/p>\n<p>iptables -I INPUT 5 -i eth0 -p tcp &#8211;dport 80 -m state &#8211;state NEW,ESTABLISHED -j ACCEPT<\/p>\n<p>service iptables save<\/p>\n<p>service iptables restart<br \/>\nNginx\u7684\u547d\u4ee4\u4ee5\u53ca\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\uff1a<\/p>\n<p>service nginx start # \u542f\u52a8Nginx\u670d\u52a1<br \/>\nservice nginx stop # \u505c\u6b62Nginx\u670d\u52a1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e00\u6b65\uff0c\u5728\/etc\/yum.repos.d\/\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u6e90\u914d\u7f6e\u6587\u4ef6nginx.repo\uff1a cd \/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-398","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/www.kejidana.com\/index.php?rest_route=\/wp\/v2\/posts\/398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.kejidana.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.kejidana.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.kejidana.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.kejidana.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=398"}],"version-history":[{"count":0,"href":"http:\/\/www.kejidana.com\/index.php?rest_route=\/wp\/v2\/posts\/398\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.kejidana.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.kejidana.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.kejidana.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}