﻿{"id":1582,"date":"2011-05-07T23:39:09","date_gmt":"2011-05-07T15:39:09","guid":{"rendered":"http:\/\/blog.jixin.ntxz.net\/?p=1582"},"modified":"2011-05-07T23:39:09","modified_gmt":"2011-05-07T15:39:09","slug":"ubuntu-%e5%ae%89%e8%a3%85-nginx","status":"publish","type":"post","link":"http:\/\/www.ntxz.net\/?p=1582","title":{"rendered":"Ubuntu \u5b89\u88c5 Nginx"},"content":{"rendered":"<p>\u4e0b\u8f7dnginx\u6e90\u7801\u5305\uff08\u4ecehttp:\/\/wiki.nginx.org\/NginxChs\u4e0a\uff09<\/p>\n<p>\u7f16\u8bd1nginx\u9700\u8981\u6307\u5b9apcre\uff0czlib\uff0copenssl\uff0c\u65e2\u7136\u6211\u7684\u7cfb\u7edf\u6ca1\u6709\u5b89\u88c5\u8fd9\u4e9b\u5305\uff0c\u6211\u4e5f\u4e0d\u5b89\u88c5deb\u7684\u5305\u4e86,\u76f4\u63a5\u8fd0\u884c<\/p>\n<p>\u7136\u540e\u4e5f\u5c06nginx-0.6.32\u7684\u5305\u89e3\u538b\u5230\/opt\u76ee\u5f55\u4e0b\uff0c\u8fdb\u5165nginx\u76ee\u5f55\uff0c\u6267\u884c\uff1a<br \/>\n#.\/configure &#8211;sbin-path=\/usr\/local\/sbin &#8211;with-http_ssl_module &#8211;with-pcre=..\/pcre-7.7 &#8211;with-zlib=..\/zlib-1.2.3 &#8211;with-openssl=..\/openssl-0.9.8g<br \/>\n#make &#038;&#038; make install<\/p>\n<p>\u5982\u679c\u5728.\/configure\u65f6\u51fa\u73b0\u5728\u9519\u8bef\uff0c\u4f9d\u6b21\u67e5\u8be2\u95ee\u9898\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\u4e0d\u4f1a\u51fa\u73b0\u4ec0\u4e48\u9519\u8bef\uff0c\u4f46\u524d\u63d0\u9700\u8981\u5b89\u88c5build-essential\uff0c\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u7f16\u8bd1\u73af\u5883<br \/>\n#apt-get install build-essential<\/p>\n<p>\u9ed8\u8ba4nginx\u5b89\u88c5\u7684\u76ee\u5f55\u5728\/usr\/local\/nginx\u4e0b\uff0c\u5305\u62ec\uff1a<\/p>\n<p>\/usr\/local\/nginx\/sbin #\u63a7\u5236nginx\u542f\u52a8\u6587\u4ef6<br \/>\n\/usr\/local\/nginx\/conf \uff03\u914d\u7f6e\u6587\u4ef6<br \/>\n\/usr\/local\/nginx\/html \uff03\u9ed8\u8ba4\u7f51\u9875\u6587\u4ef6<br \/>\n\/usr\/local\/nginx\/logs \uff03\u65e5\u5fd7\u6587\u4ef6<\/p>\n<p>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<\/p>\n<p>\u8f6c\uff1ahttp:\/\/docs.google.com\/View?docid=dhf86kr9_302cssf49dh&#038;hgd=1<\/p>\n<p>Nginx (&#8220;engine x&#8221;) \u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684 HTTP \u548c \u53cd\u5411\u4ee3\u7406 \u670d\u52a1\u5668\uff0c\u76f8\u5bf9Apache\u7684\u81c3\u80bf\uff0cNginx\u7edd\u5bf9\u662f\u8f7b\u91cf\u7ea7\u7684\uff0c\u914d\u7f6e\u7b80\u5355\uff0c\u672c\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u5982\u4f55\u5728Ubuntu Hardy \u4e0a\u7528\u6e90\uff0c\u7801\u6765\u7f16\u8bd1Nginx\u3002<\/p>\n<p>\u4e00\u3001\u9009\u62e9\u7248\u672c<br \/>\n\u9009 \u62e9\u4ece\u6e90\u7801\u7f16\u8bd1Nginx\u7684\u5927\u591a\u6570\u539f\u56e0\u662f\u53ef\u4ee5\u91c7\u7528\u6700\u65b0\u7684\u7248\u672c\uff0c\u800c\u4e0d\u5c40\u9650\u4e8eaptitude\u5b89\u88c5\u7684\u65e7\u7248\u672c\uff0c\u5728\u5199\u672c\u6587\u7684\u65f6\u5019\uff0cNginx\u7684\u6700\u65b0\u7a33\u5b9a\u7248\u672c\u662f 0.6.31\uff08\u4f60\u53ef\u4ee5\u5230Nginx\u7684\u5b98\u65b9\u7ad9\u70b9\u67e5\u770b\u6700\u65b0\u7248\u672c\uff09\uff0c\u800captitude\u5b89\u88c5\u7684\u662f0.5.33\u7248\u672c\u3002<br \/>\n\u5f53\u7136\uff0c\u91c7\u7528\u6e90\u7801\u7f16\u8bd1\u4f1a\u6bd4aptitude\u9ebb\u70e6\u4e00\u4e9b\uff0c\u4ee5\u540e\u66f4\u65b0\u90fd\u9700\u8981DIY\uff0c\u5982\u679c\u4f60\u559c\u6b22\u65b9\u4fbf\uff0c\u4e14\u5bf9\u7248\u672c\u4e0d\u662f\u5f88\u654f\u611f\u7684\u8bdd\uff0c\u4f60\u53ef\u4ee5\u53c2\u8003\u524d \u9762\u4e00\u7bc7\u6587\u7ae0\u201c\u4f7f\u7528aptitude\u5b89\u88c5Nginx\u201d\u91c7\u7528aptitude\u6765\u5b89\u88c5\u3002<\/p>\n<p>\u4e8c\u3001\u6ce8\u610f\u76ee\u5f55\u7ed3\u6784<br \/>\n\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u91c7\u7528aptitude\u5b89\u88c5Nginx\u548c\u4ece\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5\u7684Nginx\u7684\u65f6\u5019\uff0c\u76ee\u5f55\u7ed3\u6784\u662f\u6709 \u6240\u4e0d\u540c\u7684\uff0c\u4f7f\u7528aptitude\u5b89\u88c5\u7684Nginx\u4f1a\u5728\u5176\u5b89\u88c5\u76ee\u5f55\u4e2d\u521b\u5efa&#8217;sites-available&#8217; \u548c &#8216;sites-enabled&#8217;\u76ee\u5f55\uff08\u8c8c\u4f3c\u60f3Ubuntu\u4e0a\u7684Apache\u5b89\u88c5\u76ee\u5f55\u7ed3\u6784\uff09\uff0c\u800c\u4ece\u6e90\u7801\u7f16\u8bd1\u7684\u65f6\u5019\uff0c\u5e76\u4e0d\u4f1a\u81ea\u52a8\u521b\u5efa\u8fd9\u4e24\u4e2a\u76ee\u5f55\u7684\uff0c\u540e\u9762\u6211\u4eec\u4f1a \u8bf4\u5982\u4f55\u4fee\u6539\u4f7f\u5f97\u5176\u8fbe\u5230\u4e00\u81f4\uff08\u867d\u7136\u53ef\u4ee5\u4e0d\u7528\u4fee\u6539\uff0c\u4f46\u662f\u628a\u6bcf\u4e2aweb\u7684\u914d\u7f6e\u653e\u5230\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u603b\u6bd4\u6df7\u5408\u5728\u4e00\u8d77\u597d\uff09\u3002<\/p>\n<p>\u4e09\u3001\u4f9d\u8d56\u5173\u7cfb<br \/>\n\u91c7\u7528aptitude\u5b89\u88c5\u7684\u65f6\u5019\uff0c\u7cfb\u7edf\u4f1a\u5c06\u6240\u6709\u4f9d\u8d56\u7684\u5305\u90fd\u4e00\u5e76\u88c5\u4e0a\uff0c\u4f46\u662f\u4f7f \u7528\u6e90\u7801\u7f16\u8bd1\u7684\u65f6\u5019\u5c31\u6ca1\u8fd9\u4e48\u667a\u80fd\u4e86\uff0c\u6211\u4eec\u9700\u8981\u627e\u5230\u9700\u8981\u7684\u4f9d\u8d56\u5305\uff0c\u7136\u540e\u624b\u5de5\u5b89\u88c5\uff0c\u5e78\u8fd0\u7684\u662f\uff0c\u8fd9\u5e76\u4e0d\u590d\u6742\uff0c\u4e5f\u4e0d\u591a\uff0c\u4f8b\u5982pcre, ssl \u548czlib\uff0c\u5b89\u88c5\u65b9\u6cd5\u6bd4\u8f83\u7b80\u5355\uff1a<\/p>\n<p>sudo aptitude install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev<\/p>\n<p>\u56db\u3001\u5b89\u88c5Nginx<br \/>\nok\uff0c\u51c6\u5907\u5de5\u4f5c\u505a\u5b8c\u4e86\uff0c\u662f\u65f6\u5019\u5f00\u59cb\u4e0b\u8f7d\u3001 \u5b89\u88c5Nginx\u4e86\u3002<br \/>\n1\u3001\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55<\/p>\n<p>mkdir ~\/sources<br \/>\ncd ~\/sources\/<\/p>\n<p>2\u3001 \u4e0b\u8f7d\u6e90\u4ee3\u7801<\/p>\n<p>wget http:\/\/sysoev.ru\/nginx\/nginx-0.6.31.tar.gz<\/p>\n<p>3\u3001 \u89e3\u538b<\/p>\n<p>tar -zxvf nginx-0.6.31.tar.gz<br \/>\n&#8230;<br \/>\ncd nginx-0.6.31\/<\/p>\n<p>4\u3001\u9009\u62e9\u9700\u8981\u7684\u7f16\u8bd1\u9009\u9879<br \/>\nNginx\u7684\u7f16\u8bd1\u9009\u9879\u8fd8\u662f\u4e0d\u5c11 \u7684\uff0c\u4f60\u53ef\u4ee5\u53c2\u8003Nginx wiki\u7684Install Options \u8fd9\u4e2a\u9875\u9762\u6216\u8005\u6211\u4e0b\u9762\u7684\u9644\u5f551\u6765\u4e86\u89e3\u6bcf\u4e2a\u9009\u9879\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u57fa\u672c\u4e0a\u90fd\u662f\u5b9a\u5236\u4f4d\u7f6e\u548c\u6a21\u5757\u7684\uff0c\u8fd9\u91cc\u5c31\u662f\u8981\u4e24\u4e2a\u6a21\u5757\u5c31\u591f\u4e86\uff08\u8981\u662f\u4f60\u6709\u81ea\u5df1\u7684\u9700\u6c42\uff0c\u81ea\u5df1DIY\uff09\uff0c\u5206\u522b \u662f\uff1a<br \/>\n1\uff09&#8211;sbin-path=\/usr\/local\/sbin<br \/>\n\u4ece\u6e90\u7801\u7f16 \u8bd1Nginx\u4f1a\u5b89\u88c5\u5728\/usr\/local\/nginx\u76ee\u5f55\u4e0b\uff08\u4f60\u53ef\u4ee5\u4f7f\u7528\u53c2\u6570&#8211;prefix=<path>\u6307\u5b9a\u81ea\u5df1\u9700\u8981\u7684\u4f4d\u7f6e\uff09\uff0c\u7136\u540e\u4f1a \u5c06bin\u6587\u4ef6\u653e\u5728\/usr\/local\/nginx\/sbin\/nginx\uff0c\u867d\u7136\u6bd4\u8f83\u6e05\u6670\uff0c\u4f46\u662f\u548c\u6211\u4eec\u4e00\u822c\u7684\u4e60\u60ef\u4e0d\u540c\uff08\u6211\u4eec\u4e60\u60ef\u5728\/usr\/local \/sbin\u4e0b\u5bfb\u627ebin\u6587\u4ef6\uff09\uff1b<br \/>\n2\uff09&#8211;with-http_ssl_module<br \/>\n\u8fd9\u4e2a\u6ca1\u5565\u597d\u8bf4\u7684\uff0c\u4e3b\u8981\u662f\u63d0\u4f9bhttps\u8bbf\u95ee\u652f\u6301\u7684\u3002<\/p>\n<p>5\u3001 Compile<\/p>\n<p>.\/configure &#8211;sbin-path=\/usr\/local\/sbin &#8211;with-http_ssl_module<\/p>\n<p>\u7f16 \u8bd1\u7684\u65f6\u95f4\u4e0d\u4f1a\u5f88\u957f\uff0c\u5b8c\u6210\u7684\u65f6\u5019\u4f60\u4f1a\u5728\u5c4f\u5e55\u4e0a\u770b\u5230\u7c7b\u4f3c\u4e0b\u9762\u7684\u4fe1\u606f\uff1a<\/p>\n<p>&#8230;<br \/>\nnginx path prefix: &#8220;\/usr\/local\/nginx&#8221;<br \/>\nnginx binary file: &#8220;\/usr\/local\/sbin&#8221;<br \/>\nnginx configuration file: &#8220;\/usr\/local\/nginx\/conf\/nginx.conf&#8221;<br \/>\n&#8230;<\/p>\n<p>\u7559 \u610f\u4e0a\u9762\u7684\u63d0\u793a\uff0c\u6d89\u53ca\u5230nginx\u7684\u51e0\u4e2a\u91cd\u8981\u6587\u4ef6\u7684\u8def\u5f84\u4fe1\u606f\u3002<\/p>\n<p>6\u3001Make &#038;&#038; make install<br \/>\n\u5dee\u4e0d\u591a\u5feb\u5b8c\u6210\u4e86\uff0c\u73b0\u5728make\u4e00\u4e0b\u3002<\/p>\n<p>make<br \/>\n&#8230;<br \/>\nsudo make install<\/p>\n<p>7\u3001chmod<br \/>\n\u8fd8\u9700 \u8981\u7ed9bin\u6587\u4ef6\u6709\u6267\u884c\u6743\u9650\uff0c\u4e5f\u6bd4\u8f83\u7b80\u5355\uff1a<\/p>\n<p>chmod +x \/usr\/local\/sbin\/nginx<br \/>\n\u4e94\u3001\u4f7f\u7528<br \/>\n\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u8bd5\u7740\u4f7f\u7528\u4e0b\u3002<br \/>\n1\u3001\u542f\u52a8<\/p>\n<p>sudo \/usr\/local\/sbin\/nginx    (\u542f\u52a8)<br \/>\n\/usr\/local\/sbin\/nginx -s stop (\u505c\u6b62)<br \/>\n\/usr\/local\/sbin\/nginx -s reload (\u91cd\u542f)<\/p>\n<p>\u7136\u540e\u628a\u81ea\u5df1\u7684\u6d4f\u89c8\u5668\u5bfc\u822a\u5230http:\/\/IP\u5c31\u53ef \u4ee5\u770b\u5230\u9ed8\u8ba4\u7684\u6b22\u8fce\u754c\u9762\u4e86\uff0c\u5982\u4e0b\uff1a<\/p>\n<p>2\u3001\u505c\u6b62<br \/>\n\u5982\u679c\u4f60\u4f7f\u7528\u8fc7apache\u6216\u8005\u770b\u5230\u524d\u9762\u90a3\u7bc7\u4f7f\u7528aptitude\u5b89\u88c5Nginx\u7684\u8bdd\uff0c\u4f60\u53ef\u80fd\u4f1a\u5bf9\/etc\/init.d\/\u4e0b\u7684\u90a3 \u4e2anginx\u811a\u672c\u5370\u8c61\u6bd4\u8f83\u6df1\u523b\uff0c\u4f7f\u7528\/etc\/init.d\/nginx\u53ef\u4ee5\u76f4\u63a5start\u6216\u8005stop\uff0c\u4f46\u662f\uff0c\u4ece\u6e90\u7801\u7f16\u8bd1\u7684Nginx\u662f\u6ca1\u6709\u81ea\u52a8\u521b\u5efa\u8fd9 \u4e2a\u811a\u672c\u7684\uff08\u540e\u9762\u4f1a\u544a\u8bc9\u4f60\u600e\u4e48\u624b\u5de5\u521b\u5efa\uff09\uff0c\u73b0\u5728\u770b\u770b\u5728\u6ca1\u6709\u521b\u5efa\u8fd9\u4e2a\u811a\u672c\u524d\uff0c\u5982\u4f55\u4e86stop\u3002<br \/>\n\u6216\u8bb8\u4f60\u5df2\u7ecf\u6ce8\u610f\u7f16\u8bd1\u7684\u65f6\u5019\uff0c\u6709\u8fd9 \u4e2a\u63d0\u793a\u201cnginx pid file: &#8220;\/usr\/local\/nginx\/logs\/nginx.pid&#8221;\u201d\uff0c\u4f60\u53ef\u4ee5cat\u4e0b\u770b\u770b\uff0c\u4ed6\u8bb0\u5f55\u7684\u5c31\u662f\u5f53\u524dnginx\u7684pid\u53f7\uff0c\u4e8e\u662f\u6211\u4eec\u5c31\u53ef\u4ee5\u8fd9 \u6837\u6765\u505c\u6b62nginx\u4e86\u3002<\/p>\n<p>sudo kill `cat \/usr\/local\/nginx\/logs\/nginx.pid`<\/p>\n<p>\u7279\u522b\u6ce8\u610f\uff1a\u8fd9\u91cc\u4f7f\u7528\u7684\u662f\u53cd \u5f15\u53f7(`)\u800c\u4e0d\u662f\u5355\u5f15\u53f7(&#8216;).<\/p>\n<p>\u516d\u3001\u5c0f\u7ed3<br \/>\n\u8fd9\u7bc7 \u6587\u7ae0\u4ecb\u7ecd\u4e86\u5982\u4f55\u5728Ubuntu\u4e0a\u4f7f\u7528\u6e90\u7801\u6309\u7167\u6211\u4eec\u7684\u9700\u8981\u6765\u7f16\u8bd1\u5b89\u88c5nginx\uff0c\u7136\u540e\u4ecb\u7ecd\u4e86\u5982\u4f55\u624b\u5de5\u542f\u52a8\u548c\u505c\u6b62nginx\uff0c\u524d\u9762\u4e5f\u63d0\u5230\u4e86\uff0c\u540e\u7eed\u6587\u7ae0\u4f1a\u4ecb\u7ecd\u5982 \u4f55\u521b\u5efainit\u811a\u672c\uff0c\u4ee5\u53ca\u5982\u4f55\u89c4\u5212\u8c03\u6574\u76ee\u5f55\u7ed3\u6784\uff08sites-available \u548csites-enabled\uff09\uff1b\u7136\u540e\u4f1a\u4ecb\u7ecd\u5982\u4f55\u914d\u7f6enginx\u4f7f\u5176\u66f4\u80fd\u53d1\u6325\u5a01\u529b\u3002<\/p>\n<p>\u4e03\u3001\u9644\u5f55\uff1aCompile-time options<br \/>\n\uff08\u539f\u6587\u53c2\u8003\uff1a<br \/>\nhttp:\/\/wiki.codemongers.com\/NginxInstallOptions \uff09<br \/>\nconfigure \u811a\u672c\u786e\u5b9a\u7cfb\u7edf\u6240\u5177\u6709\u4e00\u4e9b\u7279\u6027\uff0c\u7279\u522b\u662f nginx \u7528\u6765\u5904\u7406\u8fde\u63a5\u7684\u65b9\u6cd5\u3002\u7136\u540e\uff0c\u5b83\u521b\u5efa Makefile \u6587\u4ef6\u3002<\/p>\n<p>configure \u652f\u6301\u4e0b\u9762\u7684\u9009\u9879\uff1a<\/p>\n<p>1\uff09\u76ee\u5f55\u5c5e\u6027<\/p>\n<p>&#8211;prefix=<path> &#8211; Nginx\u5b89\u88c5\u8def\u5f84\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a\uff0c\u9ed8\u8ba4\u4e3a \/usr\/local\/nginx\u3002<\/p>\n<p>&#8211;sbin-path=<path> &#8211; Nginx\u53ef\u6267\u884c\u6587\u4ef6\u5b89\u88c5\u8def\u5f84\u3002\u53ea\u80fd\u5b89\u88c5\u65f6\u6307\u5b9a\uff0c\u5982\u679c\u6ca1\u6709\u6307\u5b9a\uff0c\u9ed8\u8ba4\u4e3a<prefix>\/sbin\/nginx\u3002<\/p>\n<p>&#8211;conf-path=<path> &#8211; \u5728\u6ca1\u6709\u7ed9\u5b9a-c\u9009\u9879\u4e0b\u9ed8\u8ba4\u7684nginx.conf\u7684\u8def\u5f84\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a\uff0c\u9ed8\u8ba4\u4e3a<prefix>\/conf\/nginx.conf\u3002<\/p>\n<p>&#8211;pid-path=<path> &#8211; \u5728nginx.conf\u4e2d\u6ca1\u6709\u6307\u5b9apid\u6307\u4ee4\u7684\u60c5\u51b5\u4e0b\uff0c\u9ed8\u8ba4\u7684nginx.pid\u7684\u8def\u5f84\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a\uff0c\u9ed8\u8ba4\u4e3a <prefix>\/logs\/nginx.pid\u3002<\/p>\n<p>&#8211;lock-path=<path> &#8211; nginx.lock\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u9ed8\u8ba4\u4e3a<prefix>\/logs\/nginx.lock<\/p>\n<p>&#8211;error-log-path=<path> &#8211; \u5728nginx.conf\u4e2d\u6ca1\u6709\u6307\u5b9aerror_log\u6307\u4ee4\u7684\u60c5\u51b5\u4e0b\uff0c\u9ed8\u8ba4\u7684\u9519\u8bef\u65e5\u5fd7\u7684\u8def\u5f84\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a\uff0c\u9ed8\u8ba4\u4e3a <prefix>\/logs\/error.log\u3002<\/p>\n<p>&#8211;http-log-path=<path> &#8211; \u5728nginx.conf\u4e2d\u6ca1\u6709\u6307\u5b9aaccess_log\u6307\u4ee4\u7684\u60c5\u51b5\u4e0b\uff0c\u9ed8\u8ba4\u7684\u8bbf\u95ee\u65e5\u5fd7\u7684\u8def\u5f84\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a\uff0c\u9ed8\u8ba4\u4e3a <prefix>\/logs\/access.log\u3002<\/p>\n<p>&#8211;user=<user> &#8211; \u5728nginx.conf\u4e2d\u6ca1\u6709\u6307\u5b9auser\u6307\u4ee4\u7684\u60c5\u51b5\u4e0b\uff0c\u9ed8\u8ba4\u7684nginx\u4f7f\u7528\u7684\u7528\u6237\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a\uff0c\u9ed8\u8ba4\u4e3a nobody\u3002<\/p>\n<p>&#8211;group=<group> &#8211; \u5728nginx.conf\u4e2d\u6ca1\u6709\u6307\u5b9auser\u6307\u4ee4\u7684\u60c5\u51b5\u4e0b\uff0c\u9ed8\u8ba4\u7684nginx\u4f7f\u7528\u7684\u7ec4\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a\uff0c\u9ed8\u8ba4\u4e3a nobody\u3002<\/p>\n<p>&#8211;builddir=DIR &#8211; \u6307\u5b9a\u7f16\u8bd1\u7684\u76ee\u5f55<\/p>\n<p>2\uff09\u6a21\u5757<\/p>\n<p>&#8211;with-rtsig_module &#8211; \u542f\u7528 rtsig \u6a21\u5757<\/p>\n<p>&#8211;with-select_module &#8211;without-select_module -\u5141\u8bb8\u6216\u4e0d\u5141\u8bb8\u5f00\u542fSELECT\u6a21\u5f0f\uff0c\u5982\u679c configure \u6ca1\u6709\u627e\u5230\u66f4\u5408\u9002\u7684\u6a21\u5f0f\uff0c\u6bd4\u5982\uff1akqueue(sun os),epoll (linux kenel 2.6+), rtsig(\u5b9e\u65f6\u4fe1\u53f7)\u6216\u8005\/dev\/poll(\u4e00\u79cd\u7c7b\u4f3cselect\u7684\u6a21\u5f0f\uff0c\u5e95\u5c42\u5b9e\u73b0\u4e0eSELECT\u57fa\u672c\u76f8 \u540c\uff0c\u90fd\u662f\u91c7\u7528\u8f6e\u8bad\u65b9\u6cd5) SELECT\u6a21\u5f0f\u5c06\u662f\u9ed8\u8ba4\u5b89\u88c5\u6a21\u5f0f<\/p>\n<p>&#8211;with-poll_module &#8211;without-poll_module &#8211; Whether or not to enable the poll module. This module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or \/dev\/poll is not discovered by configure.<\/p>\n<p>&#8211;with-http_ssl_module -\u5f00\u542fHTTP SSL\u6a21\u5757\uff0c\u4f7fNGINX\u53ef\u4ee5\u652f\u6301HTTPS\u8bf7\u6c42\u3002\u8fd9\u4e2a\u6a21\u5757\u9700\u8981\u5df2\u7ecf\u5b89\u88c5\u4e86OPENSSL\uff0c\u5728DEBIAN\u4e0a\u662flibssl<\/p>\n<p>&#8211;with-http_realip_module &#8211; \u542f\u7528 ngx_http_realip_module<\/p>\n<p>&#8211;with-http_addition_module &#8211; \u542f\u7528 ngx_http_addition_module<\/p>\n<p>&#8211;with-http_sub_module &#8211; \u542f\u7528 ngx_http_sub_module<\/p>\n<p>&#8211;with-http_dav_module &#8211; \u542f\u7528 ngx_http_dav_module<\/p>\n<p>&#8211;with-http_flv_module &#8211; \u542f\u7528 ngx_http_flv_module<\/p>\n<p>&#8211;with-http_stub_status_module &#8211; \u542f\u7528 &#8220;server status&#8221; \u9875<\/p>\n<p>&#8211;without-http_charset_module &#8211; \u7981\u7528 ngx_http_charset_module<\/p>\n<p>&#8211;without-http_gzip_module &#8211; \u7981\u7528 ngx_http_gzip_module. \u5982\u679c\u542f\u7528\uff0c\u9700\u8981 zlib \u3002<\/p>\n<p>&#8211;without-http_ssi_module &#8211; \u7981\u7528 ngx_http_ssi_module<\/p>\n<p>&#8211;without-http_userid_module &#8211; \u7981\u7528 ngx_http_userid_module<\/p>\n<p>&#8211;without-http_access_module &#8211; \u7981\u7528 ngx_http_access_module<\/p>\n<p>&#8211;without-http_auth_basic_module &#8211; \u7981\u7528 ngx_http_auth_basic_module<\/p>\n<p>&#8211;without-http_autoindex_module &#8211; \u7981\u7528 ngx_http_autoindex_module<\/p>\n<p>&#8211;without-http_geo_module &#8211; \u7981\u7528 ngx_http_geo_module<\/p>\n<p>&#8211;without-http_map_module &#8211; \u7981\u7528 ngx_http_map_module<\/p>\n<p>&#8211;without-http_referer_module &#8211; \u7981\u7528 ngx_http_referer_module<\/p>\n<p>&#8211;without-http_rewrite_module &#8211; \u7981\u7528 ngx_http_rewrite_module. \u5982\u679c\u542f\u7528\u9700\u8981 PCRE \u3002<\/p>\n<p>&#8211;without-http_proxy_module &#8211; \u7981\u7528 ngx_http_proxy_module<\/p>\n<p>&#8211;without-http_fastcgi_module &#8211; \u7981\u7528 ngx_http_fastcgi_module<\/p>\n<p>&#8211;without-http_memcached_module &#8211; \u7981\u7528 ngx_http_memcached_module<\/p>\n<p>&#8211;without-http_limit_zone_module &#8211; \u7981\u7528 ngx_http_limit_zone_module<\/p>\n<p>&#8211;without-http_empty_gif_module &#8211; \u7981\u7528 ngx_http_empty_gif_module<\/p>\n<p>&#8211;without-http_browser_module &#8211; \u7981\u7528 ngx_http_browser_module<\/p>\n<p>&#8211;without-http_upstream_ip_hash_module &#8211; \u7981\u7528 ngx_http_upstream_ip_hash_module<\/p>\n<p>&#8211;with-http_perl_module &#8211; \u542f\u7528 ngx_http_perl_module<\/p>\n<p>&#8211;with-perl_modules_path=PATH &#8211; \u6307\u5b9a perl \u6a21\u5757\u7684\u8def\u5f84<\/p>\n<p>&#8211;with-perl=PATH &#8211; \u6307\u5b9a perl \u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84<\/p>\n<p>&#8211;http-log-path=PATH &#8211; Set path to the http access log<\/p>\n<p>&#8211;http-client-body-temp-path=PATH &#8211; Set path to the http client request body temporary files<\/p>\n<p>&#8211;http-proxy-temp-path=PATH &#8211; Set path to the http proxy temporary files<\/p>\n<p>&#8211;http-fastcgi-temp-path=PATH &#8211; Set path to the http fastcgi temporary files<\/p>\n<p>&#8211;without-http &#8211; \u7981\u7528 HTTP server<\/p>\n<p>&#8211;with-mail &#8211; \u542f\u7528 IMAP4\/POP3\/SMTP \u4ee3\u7406\u6a21\u5757<\/p>\n<p>&#8211;with-mail_ssl_module &#8211; \u542f\u7528 ngx_mail_ssl_module<\/p>\n<p>&#8211;with-cc=PATH &#8211; \u6307\u5b9a C \u7f16\u8bd1\u5668\u7684\u8def\u5f84<\/p>\n<p>&#8211;with-cpp=PATH &#8211; \u6307\u5b9a C \u9884\u5904\u7406\u5668\u7684\u8def\u5f84<\/p>\n<p>&#8211;with-cc-opt=OPTIONS &#8211; Additional parameters which will be added to the variable CFLAGS. With the use of the system library PCRE in FreeBSD, it is necessary to indicate &#8211;with-cc-opt=&#8221;-I \/usr\/local\/include&#8221;. If we are using select() and it is necessary to increase the number of file descriptors, then this also can be assigned here: &#8211;with-cc-opt=&#8221;-D FD_SETSIZE=2048&#8243;.<\/p>\n<p>&#8211;with-ld-opt=OPTIONS &#8211; Additional parameters passed to the linker. With the use of the system library PCRE in FreeBSD, it is necessary to indicate &#8211;with-ld-opt=&#8221;-L \/usr\/local\/lib&#8221;.<\/p>\n<p>&#8211;with-cpu-opt=CPU &#8211; \u4e3a\u7279\u5b9a\u7684 CPU \u7f16\u8bd1\uff0c\u6709\u6548\u7684\u503c\u5305\u62ec\uff1apentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64<\/p>\n<p>&#8211;without-pcre &#8211; \u7981\u6b62 PCRE \u5e93\u7684\u4f7f\u7528\u3002\u540c\u65f6\u4e5f\u4f1a\u7981\u6b62 HTTP rewrite \u6a21\u5757\u3002\u5728 &#8220;location&#8221; \u914d\u7f6e\u6307\u4ee4\u4e2d\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u4e5f\u9700\u8981 PCRE \u3002<\/p>\n<p>&#8211;with-pcre=DIR &#8211; \u6307\u5b9a PCRE \u5e93\u7684\u6e90\u4ee3\u7801\u7684\u8def\u5f84\u3002<\/p>\n<p>&#8211;with-pcre-opt=OPTIONS &#8211; Set additional options for PCRE building.<\/p>\n<p>&#8211;with-md5=DIR &#8211; Set path to md5 library sources.<\/p>\n<p>&#8211;with-md5-opt=OPTIONS &#8211; Set additional options for md5 building.<\/p>\n<p>&#8211;with-md5-asm &#8211; Use md5 assembler sources.<\/p>\n<p>&#8211;with-sha1=DIR &#8211; Set path to sha1 library sources.<\/p>\n<p>&#8211;with-sha1-opt=OPTIONS &#8211; Set additional options for sha1 building.<\/p>\n<p>&#8211;with-sha1-asm &#8211; Use sha1 assembler sources.<\/p>\n<p>&#8211;with-zlib=DIR &#8211; Set path to zlib library sources.<\/p>\n<p>&#8211;with-zlib-opt=OPTIONS &#8211; Set additional options for zlib building.<\/p>\n<p>&#8211;with-zlib-asm=CPU &#8211; Use zlib assembler sources optimized for specified CPU, valid values are: pentium, pentiumpro<\/p>\n<p>&#8211;with-openssl=DIR &#8211; Set path to OpenSSL library sources<\/p>\n<p>&#8211;with-openssl-opt=OPTIONS &#8211; Set additional options for OpenSSL building<\/p>\n<p>&#8211;with-debug &#8211; \u542f\u7528\u8c03\u8bd5\u65e5\u5fd7<\/p>\n<p>&#8211;add-module=PATH &#8211; Add in a third-party module found in directory PATH<br \/>\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u8f7dnginx\u6e90\u7801\u5305\uff08\u4ecehttp:\/\/wiki.nginx.org\/NginxChs\u4e0a\uff09 \u7f16\u8bd1nginx\u9700\u8981\u6307 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[413,412],"class_list":["post-1582","post","type-post","status-publish","format-standard","hentry","category-fromnetwork","tag-nginx","tag-ubuntu"],"views":707,"_links":{"self":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/1582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1582"}],"version-history":[{"count":1,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/1582\/revisions"}],"predecessor-version":[{"id":1583,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/1582\/revisions\/1583"}],"wp:attachment":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1582"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}