{"id":92,"date":"2017-07-15T07:59:12","date_gmt":"2017-07-14T23:59:12","guid":{"rendered":"\/\/hqidi.com\/?p=92"},"modified":"2017-07-15T08:32:50","modified_gmt":"2017-07-15T00:32:50","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88nginx%e5%8f%af%e4%bb%a5%e9%80%9a%e8%bf%87%e6%9b%bf%e6%8d%a2%e5%8f%af%e6%89%a7%e8%a1%8c%e7%a8%8b%e5%ba%8f%e7%9a%84%e6%96%b9%e5%bc%8f%e5%8d%87%e7%ba%a7","status":"publish","type":"post","link":"https:\/\/hqidi.com\/92.html","title":{"rendered":"\u4e3a\u4ec0\u4e48nginx\u53ef\u4ee5\u901a\u8fc7\u66ff\u6362\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u65b9\u5f0f\u5347\u7ea7"},"content":{"rendered":"<p>\u5e73\u65f6\u7ed9nginx\u6dfb\u52a0\u6a21\u5757\uff0c\u6216\u8005\u5347\u7ea7\u7248\u672c\u7684\u65f6\u5019\uff0c\u90fd\u662f\u5728nginx\u6e90\u7801\u76ee\u5f55\u91cc\u9762.\/configure\uff0c\u7136\u540e\u91cd\u65b0make\uff0c\u6700\u540e\u7528\u6e90\u7801\u76ee\u5f55\u4e0b\uff0cobjs\u76ee\u5f55\u91cc\u9762\u7684nginx\u6765\u66ff\u6362\u539f\u672c\u7684\u8001\u7248\u672c\u53ef\u6267\u884c\u7a0b\u5e8f\u3002\u4e3a\u4ec0\u4e48\u53ef\u4ee5\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u6765\u5347\u7ea7\u5462\uff1f\u56e0\u4e3anginx\u5b89\u88c5\u540e\uff0c\u5b89\u88c5\u76ee\u5f55\u91cc\u9762\u4e00\u5806\u6587\u4ef6\uff0c\u6b63\u513f\u516b\u7ecf\u5e72\u6d3b\u7684\u5176\u5b9e\u5c31sbin\/nginx\u4e00\u4e2a\u3002\u5176\u4ed6\u7684\u90fd\u662f\u9f99\u5957\u3002\u73b0\u5728\u6211\u4eec\u540c\u65f6\u5b89\u88c5\u4e24\u4e2a\u7248\u672c\uff0c\u7136\u540e\u5bf9\u6bd4\u4e24\u4e2a\u5b89\u88c5\u76ee\u5f55\u91cc\u9762\u6240\u6709\u7684\u6587\u4ef6\uff0c\u4f1a\u53d1\u73b0\uff0c\u9664\u4e86sbin\/nginx\u4e0d\u540c\uff0c\u5176\u4ed6\u7684\u6587\u4ef6\u90fd\u662f\u4e00\u6a21\u4e00\u6837\u7684\u3002<\/p>\n<pre class=\"prettyprint\" >\r\n#\u5148\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u7ec4\u4ef6\r\nyum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre-devel\r\n#\u4e0b\u8f7d\r\nwget http:\/\/nginx.org\/download\/nginx-1.12.1.tar.gz\r\nwget http:\/\/nginx.org\/download\/nginx-1.10.3.tar.gz\r\ntar xf nginx-1.12.1.tar.gz\r\ntar xf nginx-1.10.3.tar.gz\r\n#\u6dfb\u52a0\u7528\u6237\r\nuseradd -s \/sbin\/nologin -M www\r\n#\u5b89\u88c5\r\ncd nginx-1.12.1\r\n.\/configure --user=www --group=www --prefix=\/usr\/local\/nginx12  --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module && make && make install \r\ncd ..\/nginx-1.10.3\r\n.\/configure --user=www --group=www --prefix=\/usr\/local\/nginx10  --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module && make && make install \r\n<\/pre>\n<p>\u7136\u540e\u6211\u4eec\u628a\/usr\/local\/nginx12\u548c\/usr\/local\/nginx10\u76ee\u5f55\u91cc\u9762\u7684\u6240\u6709\u6587\u4ef6\u751f\u6210md5\u6821\u9a8c\u503c\u3002<\/p>\n<pre class=\"prettyprint\" >\r\n[root@test local]# ls\r\nbin  etc  games  include  lib  lib64  libexec  nginx10  nginx12  sbin  share  src\r\n[root@test local]# cd nginx10 && md5deep -lr .\/ > ..\/nginx10.md5\r\n[root@test local]# cd nginx12 && md5deep -lr .\/ > ..\/nginx12.md5\r\n[root@test local]# cat nginx12.md5 \r\ne3eb0a1df437f3f97a64aca5952c8ea0  .\/html\/index.html\r\nd74f9cdd604653c22c6752c46fffd587  .\/html\/50x.html\r\n3a0b1f2d0a5734fe3200a48703bafed2  .\/conf\/nginx.conf\r\n88ac833ee8ea60904a8b3063fde791de  .\/conf\/uwsgi_params\r\n3a0b1f2d0a5734fe3200a48703bafed2  .\/conf\/nginx.conf.default\r\n3e338aca6a53a5420fc791b5ef86f64c  .\/conf\/koi-utf\r\n4729c30112ca3071f4650479707993ad  .\/conf\/fastcgi_params\r\n88ac833ee8ea60904a8b3063fde791de  .\/conf\/uwsgi_params.default\r\n178a634a52a0777a4cf6f3a394fd2b53  .\/conf\/fastcgi.conf\r\nbd837e7b34f5c9b8d89957d0527f0d44  .\/conf\/mime.types.default\r\n3749ffe19bedd842eb87e83d544e5ce6  .\/conf\/win-utf\r\n4729c30112ca3071f4650479707993ad  .\/conf\/fastcgi_params.default\r\nbfa0b80381fed2b1dfcf617b0ba204ec  .\/conf\/koi-win\r\nbd837e7b34f5c9b8d89957d0527f0d44  .\/conf\/mime.types\r\ndf8c71e25e0356ffc539742f08fddfff  .\/conf\/scgi_params.default\r\n178a634a52a0777a4cf6f3a394fd2b53  .\/conf\/fastcgi.conf.default\r\ndf8c71e25e0356ffc539742f08fddfff  .\/conf\/scgi_params\r\n0853bf74c4916a9d9b670d810b64a4e4  .\/sbin\/nginx\r\n<\/pre>\n<p>\u7136\u540e\u6211\u4eec\u5bf9\u6bd4\u4e24\u4e2a.md5\u6587\u4ef6<\/p>\n<pre class=\"prettyprint\" >\r\n[root@test local]# diff nginx10.md5 nginx12.md5\r\n19c18\r\n< 1a57e963e4b8622d5539a3230e8a4e39  .\/sbin\/nginx\r\n---\r\n> f080e4347fd34e1dfdb9fed0362a237a  .\/sbin\/nginx\r\n<\/pre>\n<p>\u65b0\u624b\u770b\u5230\u8fd9\u4e2adiff\u7684\u8f93\u51fa\u4f1a\u6709\u70b9\u4e91\u91cc\u96fe\u91cc\uff0c\u6240\u4ee5\u6211\u628a\u4e24\u4e2a.md5\u6587\u4ef6\u7684\u6700\u540e\u4e00\u884c\uff08\u5c31\u662fsbin\/nginx\u6821\u9a8c\u503c\u7684\u90a3\u4e00\u884c\uff09\u90fd\u5220\u6389<\/p>\n<pre class=\"prettyprint\" >\r\nsed -i '$d' nginx10.md5 nginx12.md5\r\n[root@test local]# diff nginx10.md5 nginx12.md5\r\n[root@test local]# echo $?\r\n0\r\n<\/pre>\n<p>diff\u6ca1\u6709\u4efb\u4f55\u8f93\u51fa\uff0c\u8bc1\u660e\u4e24\u4e2a\u6587\u4ef6\u5b8c\u5168\u4e00\u81f4\uff0c\u9f99\u5957\u8bf4\u5f97\u4ee5\u8bc1\u5b9e\u3002<br \/>\n\u5176\u5b9e\uff0c\u6211\u4eec\u53ef\u4ee5\u7528nginx10\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u7684MD5\u503cnginx10.md5\u53bb\u6821\u9a8cnginx12\u76ee\u5f55<\/p>\n<pre class=\"prettyprint\" >\r\n[root@test local]# md5deep -X nginx10.md5 -r nginx12\/*\r\nf080e4347fd34e1dfdb9fed0362a237a  \/usr\/local\/nginx12\/sbin\/nginx\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5e73\u65f6\u7ed9nginx\u6dfb\u52a0\u6a21\u5757\uff0c\u6216\u8005\u5347\u7ea7\u7248\u672c\u7684\u65f6\u5019\uff0c\u90fd\u662f\u5728nginx\u6e90\u7801\u76ee\u5f55\u91cc\u9762.\/configure\uff0c\u7136\u540e\u91cd\u65b0make\uff0c\u6700\u540e\u7528\u6e90\u7801\u76ee\u5f55\u4e0b\uff0cobjs\u76ee\u5f55\u91cc\u9762\u7684nginx\u6765\u66ff\u6362\u539f\u672c\u7684\u8001\u7248\u672c\u53ef\u6267\u884c\u7a0b\u5e8f\u3002\u4e3a\u4ec0\u4e48\u53ef\u4ee5\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u6765\u5347\u7ea7\u5462\uff1f\u56e0\u4e3anginx\u5b89\u88c5\u540e\uff0c\u5b89\u88c5\u76ee\u5f55\u91cc\u9762\u4e00\u5806\u6587\u4ef6\uff0c\u6b63\u513f\u516b\u7ecf\u5e72\u6d3b\u7684\u5176\u5b9e\u5c31sbin\/nginx\u4e00\u4e2a\u3002\u5176\u4ed6\u7684\u90fd\u662f\u9f99\u5957\u3002\u73b0\u5728\u6211\u4eec\u540c\u65f6\u5b89\u88c5\u4e24\u4e2a\u7248\u672c\uff0c\u7136\u540e...<\/p>\n<a class=\"read-more\" href=\"https:\/\/hqidi.com\/92.html\">\u9605\u8bfb\u5168\u6587 &raquo;<\/a>","protected":false},"author":1,"featured_media":3011,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-92","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-study"],"_links":{"self":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/92"}],"collection":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":3,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":3117,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/92\/revisions\/3117"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/media\/3011"}],"wp:attachment":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}