{"id":1554,"date":"2016-12-19T04:05:21","date_gmt":"2016-12-18T20:05:21","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=1554"},"modified":"2016-12-19T04:05:21","modified_gmt":"2016-12-18T20:05:21","slug":"centos-7-yum-%e5%ae%89%e8%a3%85-nginx","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/jishu\/centos-7-yum-%e5%ae%89%e8%a3%85-nginx\/","title":{"rendered":"CentOS 7 YUM \u5b89\u88c5 Nginx"},"content":{"rendered":"<h2>\u5173\u4e8eNginx<\/h2>\n<p>Nginx (\u201cengine x\u201d) \u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684 HTTP \u548c \u53cd\u5411\u4ee3\u7406 \u670d\u52a1\u5668\uff0c\u4e5f\u662f\u4e00\u4e2a IMAP\/POP3\/SMTP \u4ee3\u7406\u670d\u52a1\u5668\u3002 Nginx \u662f\u7531 Igor Sysoev \u4e3a\u4fc4\u7f57\u65af\u8bbf\u95ee\u91cf\u7b2c\u4e8c\u7684 Rambler.ru \u7ad9\u70b9\u5f00\u53d1\u7684\uff0c\u7b2c\u4e00\u4e2a\u516c\u5f00\u7248\u672c0.1.0\u53d1\u5e03\u4e8e2004\u5e7410\u67084\u65e5\u3002\u5176\u5c06\u6e90\u4ee3\u7801\u4ee5\u7c7bBSD\u8bb8\u53ef\u8bc1\u7684\u5f62\u5f0f\u53d1\u5e03\uff0c\u56e0\u5b83\u7684\u7a33\u5b9a\u6027\u3001\u4e30\u5bcc\u7684\u529f\u80fd\u96c6\u3001\u793a\u4f8b\u914d\u7f6e\u6587\u4ef6\u548c\u4f4e\u7cfb\u7edf\u8d44\u6e90\u7684\u6d88\u8017\u800c\u95fb\u540d\u3002<\/p>\n<h2>CentOS 7 \u6761\u4ef6<\/h2>\n<p>\u6559\u7a0b\u4e2d\u7684\u6b65\u9aa4\u9700\u8981<code>root<\/code>\u7528\u6237\u6743\u9650\u3002<\/p>\n<h2>1.\u6dfb\u52a0Nginx\u5230YUM\u6e90<\/h2>\n<p>\u6dfb\u52a0CentOS 7 Nginx yum\u8d44\u6e90\u5e93,\u6253\u5f00\u7ec8\u7aef,\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4:<\/p>\n<pre>sudo rpm -Uvh https:\/\/nginx.org\/packages\/centos\/7\/noarch\/RPMS\/nginx-release-centos-7-0.el7.ngx.noarch.rpm\r\n<\/pre>\n<h2>2.\u5b89\u88c5Nginx<\/h2>\n<p>\u5728\u4f60\u7684CentOS 7 \u670d\u52a1\u5668\u4e2d\u4f7f\u7528<code>yum<\/code>\u547d\u4ee4\u4eceNginx\u6e90\u670d\u52a1\u5668\u4e2d\u83b7\u53d6\u6765\u5b89\u88c5Nginx\uff1a<\/p>\n<pre><code>sudo yum install -y nginx<\/code><\/pre>\n<p>Nginx\u5c06\u5b8c\u6210\u5b89\u88c5\u5728\u4f60\u7684CentOS 7 \u670d\u52a1\u5668\u4e2d\u3002<\/p>\n<h2>3.\u542f\u52a8Nginx<\/h2>\n<p>\u521a\u5b89\u88c5\u7684Nginx\u4e0d\u4f1a\u81ea\u884c\u542f\u52a8\u3002\u8fd0\u884cNginx:<\/p>\n<pre><code>sudo systemctl start nginx.service<\/code><\/pre>\n<p>\u5982\u679c\u4e00\u5207\u8fdb\u5c55\u987a\u5229\u7684\u8bdd\uff0c\u73b0\u5728\u4f60\u53ef\u4ee5\u901a\u8fc7\u4f60\u7684\u57df\u540d\u6216IP\u6765\u8bbf\u95ee\u4f60\u7684Web\u9875\u9762\u6765\u9884\u89c8\u4e00\u4e0bNginx\u7684\u9ed8\u8ba4\u9875\u9762\uff1b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1406\" src=\"https:\/\/images.statics.9696e.com\/wp-content\/uploads\/2014\/11\/nginx_default.png\" alt=\"nginx_default\" width=\"569\" height=\"212\" \/><\/p>\n<p>\u5982\u679c\u770b\u5230\u8fd9\u4e2a\u9875\u9762,\u90a3\u4e48\u8bf4\u660e\u4f60\u7684CentOS 7 \u4e2d web\u670d\u52a1\u5668\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n<h2>CentOS 7 \u5f00\u673a\u542f\u52a8Nginx<\/h2>\n<pre><code>sudo systemctl enable nginx.service<\/code><\/pre>\n<p>\u66f4\u591asystemctl\u547d\u4ee4\u53ef\u67e5\u770b\u300a<a title=\"systemctl\u547d\u4ee4\u7528\u6cd5\" href=\"https:\/\/www.9696e.com\/archives\/1253\">systemctl\u547d\u4ee4\u7528\u6cd5<\/a>\u300b<\/p>\n<h2>Nginx\u914d\u7f6e\u4fe1\u606f<\/h2>\n<p>\u7f51\u7ad9\u6587\u4ef6\u5b58\u653e\u9ed8\u8ba4\u76ee\u5f55<\/p>\n<pre>\/usr\/share\/nginx\/html<\/pre>\n<p>\u7f51\u7ad9\u9ed8\u8ba4\u7ad9\u70b9\u914d\u7f6e<\/p>\n<pre>\/etc\/nginx\/conf.d\/default.conf<\/pre>\n<p>\u81ea\u5b9a\u4e49Nginx\u7ad9\u70b9\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u76ee\u5f55<\/p>\n<pre>\/etc\/nginx\/conf.d\/<\/pre>\n<p>Nginx\u5168\u5c40\u914d\u7f6e<\/p>\n<pre>\/etc\/nginx\/nginx.conf<\/pre>\n<p>\u5728\u8fd9\u91cc\u4f60\u53ef\u4ee5\u6539\u53d8\u8bbe\u7f6e\u7528\u6237\u8fd0\u884cNginx\u5b88\u62a4\u7a0b\u5e8f\u8fdb\u7a0b\u4e00\u6837,\u548c\u5de5\u4f5c\u8fdb\u7a0b\u7684\u6570\u91cf\u5f97\u5230\u4e86Nginx\u6b63\u5728\u8fd0\u884c,\u7b49\u7b49\u3002<\/p>\n<h2>Linux\u67e5\u770b\u516c\u7f51IP<\/h2>\n<p>\u60a8\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u663e\u793a\u4f60\u7684\u670d\u52a1\u5668\u7684\u516c\u5171IP\u5730\u5740:<\/p>\n<pre><code>ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's\/\\\/.*$\/\/'<\/code><\/pre>\n<div id=\"wp_rp_first\" class=\"wp_rp_wrap  wp_rp_plain\">\n<div class=\"wp_rp_content\">\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/www.9696e.com\/archives\/1404<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8eNginx Nginx (\u201cengine x\u201d) \u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684 HTTP \u548c \u53cd\u5411\u4ee3\u7406 \u670d\u52a1\u5668\uff0c\u4e5f\u662f\u4e00\u4e2a &#8230; <a title=\"CentOS 7 YUM \u5b89\u88c5 Nginx\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/jishu\/centos-7-yum-%e5%ae%89%e8%a3%85-nginx\/\" aria-label=\"\u9605\u8bfb CentOS 7 YUM \u5b89\u88c5 Nginx\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[49,5],"tags":[495,148],"class_list":["post-1554","post","type-post","status-publish","format-standard","hentry","category-linux","category-jishu","tag-centos7-x","tag-nginx"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=1554"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1554\/revisions"}],"predecessor-version":[{"id":1555,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1554\/revisions\/1555"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=1554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=1554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=1554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}