{"id":4827,"date":"2021-01-14T23:45:19","date_gmt":"2021-01-14T15:45:19","guid":{"rendered":"http:\/\/www.menglanglang.cn\/?p=4827"},"modified":"2022-09-16T05:50:25","modified_gmt":"2022-09-15T21:50:25","slug":"centos-%e9%80%9a%e8%bf%87%e6%ba%90%e7%a0%81%e7%bc%96%e8%af%91%e5%bd%a2%e5%bc%8f%e5%ae%89%e8%a3%85-nginx","status":"publish","type":"post","link":"http:\/\/www.menglanglang.cn\/?p=4827","title":{"rendered":"CentOS \u901a\u8fc7\u6e90\u7801\u7f16\u8bd1\u5f62\u5f0f\u5b89\u88c5 Nginx"},"content":{"rendered":"\n<p>\u672c\u7bc7\u7b80\u5355\u8bf4\u8bf4\u5728\u5982\u4f55\u5728 Linux \u7cfb\u7edf\u4e0a\u901a\u8fc7\u6e90\u7801\u7f16\u8bd1\u7684\u5f62\u5f0f\u5b89\u88c5 Nginx\uff0c\u7eaf\u5c5e\u7b14\u8bb0\u3002<\/p>\n\n\n\n<p>Nginx \u4e0b\u8f7d\u5b98\u7f51\u8def\u5f84\uff1a<a href=\"http:\/\/nginx.org\/en\/download.html\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/nginx.org\/en\/download.html<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u90e8\u7f72\u73af\u5883<\/h3>\n\n\n\n<p>Linux \u7248\u672c\uff1acentos6.9-x64<\/p>\n\n\n\n<p>Nginx \u7248\u672c\uff1anginx-1.19.6.tar.gz<\/p>\n\n\n\n<p>\u5173\u95ed Linux \u673a\u5668\u9632\u706b\u5899<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e00\u6b65\uff0c\u4e0a\u4f20\u5b89\u88c5\u5305<\/h3>\n\n\n\n<p>\u4e0a\u4f20 Nginx \u5b89\u88c5\u5305&nbsp;nginx-1.19.6.tar.gz\uff0c\u8fd9\u91cc\u4e0a\u4f20\u5230 \/root \u4e0b\u3002<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"169\" width=\"719\" alt=\"\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/20210114230003640.png\"\/><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e8c\u6b65\uff0c\u89e3\u538b\u5b89\u88c5\u5305<\/h3>\n\n\n\n<p>\u5bf9\u7b2c\u4e00\u6b65\u4e0a\u4f20\u7684\u5b89\u88c5\u5305\u8fdb\u884c\u89e3\u538b\u5e76\u8fdb\u5165\u5230\u89e3\u538b\u76ee\u5f55\uff0c\u547d\u4ee4\u5982\u4e0b\u3002<\/p>\n\n\n\n<p>\u547d\u4ee41\uff1atar -zxvf nginx-1.19.6.tar.gz<\/p>\n\n\n\n<p>\u547d\u4ee42\uff1acd nginx-1.19.6<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"74\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/2021011423060412.png\" width=\"472\"\/><img loading=\"lazy\" decoding=\"async\" src=\"blob:http:\/\/www.menglanglang.cn\/014e702f-b51d-43fc-85a9-a0a12c5b32ec\" width=\"15\" height=\"15\"\/>\u200b<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e09\u6b65\uff0c\u68c0\u67e5\u5b89\u88c5\u4f9d\u8d56<\/h3>\n\n\n\n<p>\u8fd9\u91cc\u8ba1\u5212\u628a Nginx \u5b89\u88c5\u5230 \/usr\/local \u4e0b\uff0c\u68c0\u67e5\u4f9d\u8d56\u547d\u4ee4\u5982\u4e0b\u3002<\/p>\n\n\n\n<p>\u547d\u4ee4\uff1a.\/configure --prefix=\/usr\/local\/nginx<\/p>\n\n\n\n<p>\u7ed3\u679c\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>checking for OS<br \/>&nbsp;+ Linux 2.6.32-696.el6.x86_64 x86_64<br \/>checking for C compiler ... not found<\/p><p>.\/configure: error: C compiler cc is not found<\/p><\/blockquote>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"149\" width=\"677\" alt=\"\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/20210114230814588.png\"\/><\/p>\n\n\n\n<p>\u8bf4\u660e\u7f3a\u5c11 C \u7f16\u8bd1\u73af\u5883\uff0c\u6267\u884c\u4e0b\u9762\u547d\u4ee4\u5b89\u88c5\u76f8\u5173\u73af\u5883\u5305\u3002<\/p>\n\n\n\n<p>\u547d\u4ee4\uff1ayum -y install gcc gcc-c++<\/p>\n\n\n\n<p>\u518d\u6b21\u6267\u884c\u68c0\u67e5\u4f9d\u8d56\u547d\u4ee4\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>[root@test242 nginx-1.19.6]# .\/configure --prefix=\/usr\/local\/nginx<br \/>...<\/p><p>.\/configure: error: the HTTP rewrite module requires the PCRE library.<br \/>You can either disable the module by using --without-http_rewrite_module<br \/>option, or install the PCRE library into the system, or build the PCRE library<br \/>statically from the source with nginx by using --with-pcre=&lt;path&gt; option.<\/p><p>[root@test242 nginx-1.19.6]#&nbsp;<\/p><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u56db\u6b65\uff0c\u5b89\u88c5 pcre<\/h3>\n\n\n\n<p>\u547d\u4ee4\uff1ayum -y install pcre-devel<\/p>\n\n\n\n<p>\u518d\u6b21\u6267\u884c\u68c0\u67e5\u4f9d\u8d56\u547d\u4ee4\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>[root@test242 nginx-1.19.6]# .\/configure --prefix=\/usr\/local\/nginx<br \/>...<\/p><p>.\/configure: error: the HTTP gzip module requires the zlib library.<br \/>You can either disable the module by using --without-http_gzip_module<br \/>option, or install the zlib library into the system, or build the zlib library<br \/>statically from the source with nginx by using --with-zlib=&lt;path&gt; option.<\/p><p>[root@test242 nginx-1.19.6]#&nbsp;<\/p><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e94\u6b65\uff0c\u5b89\u88c5 zlib<\/h3>\n\n\n\n<p>\u547d\u4ee4\uff1ayum -y install zlib-devel<\/p>\n\n\n\n<p>\u518d\u6b21\u6267\u884c\u68c0\u67e5\u4f9d\u8d56\u547d\u4ee4\uff0c\u53ef\u4ee5\u770b\u5230\u4e0d\u518d\u7f3a\u5c11\u4f9d\u8d56\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u516d\u6b65\uff0c\u7f16\u8bd1<\/h3>\n\n\n\n<p>\u547d\u4ee4\uff1amake<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e03\u6b65\uff0c\u5b89\u88c5<\/h3>\n\n\n\n<p>\u547d\u4ee4\uff1amake install<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u516b\u6b65\uff0c\u542f\u52a8<\/h3>\n\n\n\n<p>\u8fdb\u5165 Nginx \u7684\u5b89\u88c5\u76ee\u5f55 \/usr\/local\/nginx\uff0c\u5e76\u542f\u52a8 Nginx \u670d\u52a1\u3002<\/p>\n\n\n\n<p>\u547d\u4ee41\uff1acd \/usr\/local\/nginx\/<\/p>\n\n\n\n<p>\u547d\u4ee42\uff1a.\/sbin\/nginx<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e5d\u6b65\uff0c\u6d4b\u8bd5<\/h3>\n\n\n\n<p>\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\uff1ahttp:\/\/\u673a\u5668IP:80 \u6d4b\u8bd5\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"366\" width=\"772\" alt=\"\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/20210114233754384.png?x-oss-process=image\/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3R6aHV3Yg==,size_16,color_FFFFFF,t_70\"\/><\/p>\n\n\n\n<p>\u770b\u5230\u4e0a\u9762\u6d4b\u8bd5\u9875\uff0c\u8bf4\u660e Nginx \u5df2\u5b89\u88c5\u6210\u529f\u3002\u5982\u679c\u6253\u4e0d\u5f00\u4e0a\u9762\u9875\u9762\uff0c\u53ef\u80fd\u662f\u673a\u5668\u7684\u9632\u706b\u5899\u6ca1\u5173\uff0c\u5148\u5173\u95ed\u9632\u706b\u5899\u518d\u8fdb\u884c\u9a8c\u8bc1\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u547d\u4ee4\uff1aservice iptables stop  \u6216\u8005  systemctl stop firewalld<\/p>\n\n\n\n<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/blog.csdn.net\/tzhuwb\/article\/details\/112644593\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/blog.csdn.net\/tzhuwb\/article\/details\/112644593<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7bc7\u7b80\u5355\u8bf4\u8bf4\u5728\u5982\u4f55\u5728 Linux \u7cfb\u7edf\u4e0a\u901a\u8fc7\u6e90\u7801\u7f16\u8bd1\u7684\u5f62\u5f0f\u5b89\u88c5 Nginx\uff0c\u7eaf\u5c5e\u7b14\u8bb0\u3002 Nginx \u4e0b\u8f7d\u5b98\u7f51\u8def [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[851],"tags":[354,602,719,877,183,262,214],"class_list":["post-4827","post","type-post","status-publish","format-standard","hentry","category-nginx","tag-centos","tag-linux","tag-nginx","tag-877","tag-183","tag-262","tag-214"],"_links":{"self":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/4827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4827"}],"version-history":[{"count":4,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/4827\/revisions"}],"predecessor-version":[{"id":4849,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/4827\/revisions\/4849"}],"wp:attachment":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4827"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}