<br />
<b>Warning</b>:  Undefined array key "HTTP_ACCEPT_LANGUAGE" in <b>/www/wwwroot/01xj.net/wp-content/plugins/wp-ue/main.php</b> on line <b>13</b><br />
{"id":117,"date":"2011-09-19T13:04:24","date_gmt":"2011-09-19T13:04:24","guid":{"rendered":"http:\/\/www.01xj.net\/0\/?p=117"},"modified":"2011-09-19T13:04:24","modified_gmt":"2011-09-19T13:04:24","slug":"freebsd-nginx-%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.01xj.net\/?p=117","title":{"rendered":"FreeBSD + Nginx \u73af\u5883\u642d\u5efa\u6559\u7a0b"},"content":{"rendered":"<p>\u524d\u8a00\uff1a\u672c\u6587\u662f\u5173\u4e8e\u5982\u4f55\u642d\u5efa\u57fa\u4e8e\u201cFreeBSD7.2 + Nginx0.8.24 + PHP5.2.11(FastCGI) + GD2.0.53 + ZendOptimizer3.3.9 + Mysql5.1.40 + \u7cfb\u7edf\u4f18\u5316 + \u9632ddos\u653b\u51fb\u201d\u9ad8\u6027\u80fd\u3001\u9ad8\u8d1f\u8f7dWeb\u670d\u52a1\u5668\u7684\u6587\u7ae0\uff0c\u5b89\u88c5\u65b9\u5f0f\u4e3a\u6e90\u4ee3\u7801\u5b89\u88c5\u3002<\/p>\n<p>Ports \u65b9\u5f0f\u5b89\u88c5\u8bf7\u53c2\u8003\uff1a http:\/\/www.excms.cn\/manual\/freebsd-nginx-php-mysql-ports.html<br \/>\n\u6587\u6863\u76ee\u5f55<\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u9009\u62e9 FreeBSD?<br \/>\n\u4e3a\u4ec0\u4e48\u8981\u9009\u62e9 Nginx?<br \/>\n\u5b89\u88c5 FreeBSD7.2<br \/>\n\u83b7\u53d6\u76f8\u5173\u5f00\u6e90\u8f6f\u4ef6\u5305<br \/>\n\u5b89\u88c5 Mysql5.1.40<br \/>\n\u5b89\u88c5 Nginx<br \/>\n\u5b89\u88c5 pcre8.00<br \/>\n\u5b89\u88c5 Nginx0.8.24<br \/>\n\u5b89\u88c5 libxml2-2.7.6<br \/>\n\u5b89\u88c5 GD<br \/>\n\u5b89\u88c5 zlib1.2.3<br \/>\n\u5b89\u88c5 libpng1.2.40<br \/>\n\u5b89\u88c5 jpeg7<br \/>\n\u5b89\u88c5 freetype2.3.11<br \/>\n\u5b89\u88c5 gd2.0.35<br \/>\n\u5b89\u88c5 PHP<br \/>\n\u5b89\u88c5 libiconv1.13<br \/>\n\u5b89\u88c5 php5.2.11(FastCGI\u6a21\u5f0f)<br \/>\n\u5b89\u88c5 ZendOptimizer3.3.9<br \/>\n\u6d4b\u8bd5<br \/>\n\u7cfb\u7edf\u4f18\u5316<br \/>\n\u9632ddos\u653b\u51fb<\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u9009\u62e9 FreeBSD?<\/p>\n<p>\u5b98\u65b9\u7f51\u7ad9\uff1awww.freebsd.org \u4e2d\u6587\u7f51\u7ad9\uff1ahttp:\/\/www.freebsd.org\/zh_CN\/<br \/>\nFreeBSD\u662f\u4e00\u4e2a\u4f18\u79c0\u7684unix\u64cd\u4f5c\u7cfb\u7edf\uff0c\u57fa\u4e8e\u5bbd\u677e\u7684BSD\u534f\u8bae\uff0c\u662f\u5b8c\u7f8e\u7684\u4f01\u4e1a\u7ea7\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4ee5\u91cd\u70b9\u7a81\u51fa\u6027\u80fd\u548c\u5b89\u5168\u800c\u95fb\u540d\uff0c\u884c\u4e1a\u9886\u5148\u7684\u4f01\u4e1a\u591a\u5e74\u4ee5\u6765\u4e00\u76f4\u4f7f\u7528FreeBSD\u670d\u52a1\u5668\u3002\u5177\u6709\u540c\u6240\u6709\u5176\u5b83\u5f00\u6e90\u8f6f\u4ef6\u64cd\u4f5c\u7cfb\u7edf\u7ade\u4e89\u7684\u9ad8\u7ea7\u6027\u80fd\u3002<\/p>\n<p>Unix\u517c\u5bb9\u6027\u5f3a<br \/>\n\u901f\u5ea6\u5feb<br \/>\n\u6781\u5176\u7a33\u5b9a\u3001\u53ef\u9760<br \/>\n\u5f3a\u5927\u7684\u7f51\u7edc\u529f\u80fd<br \/>\n\u591a\u7528\u6237\u3001\u591a\u4efb\u52a1<br \/>\n\u4f7f\u7528\u65b9\u4fbf(\u6309\u7167\u6781\u597d\u7684\u8bf4\u660e\u6587\u4ef6\u64cd\u4f5c)<\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u9009\u62e9 Nginx?<\/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\u4e5f\u662f\u4e00\u4e2a IMAP\/POP3\/SMTP \u4ee3\u7406\u670d\u52a1\u5668\u3002Nginx \u662f\u7531 Igor Sysoev \u4e3a\u4fc4\u7f57\u65af\u8bbf\u95ee\u91cf\u7b2c\u4e8c\u7684Rambler.ru \u7ad9\u70b9\u5f00\u53d1\u7684\uff0c\u5b83\u5df2\u7ecf\u5728\u8be5\u7ad9\u70b9\u8fd0\u884c\u8d85\u8fc7\u56db\u5e74\u591a\u4e86\u3002Igor \u5c06\u6e90\u4ee3\u7801\u4ee5\u7c7bBSD\u8bb8\u53ef\u8bc1\u7684\u5f62\u5f0f\u53d1\u5e03\u3002\u81eaNginx \u53d1\u5e03\u56db\u5e74\u6765\uff0cNginx \u5df2\u7ecf\u56e0\u4e3a\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\u4e86\u3002\u76ee\u524d\u56fd\u5185\u5404\u5927\u95e8\u6237\u7f51\u7ad9\u5df2\u7ecf\u90e8\u7f72\u4e86Nginx\uff0c\u5982\u65b0\u6d6a\u3001\u7f51\u6613\u3001\u817e\u8baf\u7b49\uff1b\u56fd\u5185\u51e0\u4e2a\u91cd\u8981\u7684\u89c6\u9891\u5206\u4eab\u7f51\u7ad9\u4e5f\u90e8\u7f72\u4e86Nginx\uff0c\u5982\u516d\u623f\u95f4\u3001\u91776\u7b49\u3002 \u65b0\u8fd1\u53d1\u73b0Nginx \u6280\u672f\u5728\u56fd\u5185\u65e5\u8d8b\u706b\u70ed\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u7f51\u7ad9\u5f00\u59cb\u90e8\u7f72Nginx\u3002<\/p>\n<p>Nginx \u662f\u4e00\u4e2a\u5f88\u725b\u7684\u9ad8\u6027\u80fdWeb\u548c\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668, \u5b83\u5177\u6709\u6709\u5f88\u591a\u975e\u5e38\u4f18\u8d8a\u7684\u7279\u6027:<\/p>\n<p>\u5728\u9ad8\u8fde\u63a5\u5e76\u53d1\u7684\u60c5\u51b5\u4e0b\uff0cNginx\u662fApache\u670d\u52a1\u5668\u4e0d\u9519\u7684\u66ff\u4ee3\u54c1: Nginx\u5728\u7f8e\u56fd\u662f\u505a\u865a\u62df\u4e3b\u673a\u751f\u610f\u7684\u8001\u677f\u4eec\u7ecf\u5e38\u9009\u62e9\u7684\u8f6f\u4ef6\u5e73\u53f0\u4e4b\u4e00. \u80fd\u591f\u652f\u6301\u9ad8\u8fbe 50,000 \u4e2a\u5e76\u53d1\u8fde\u63a5\u6570\u7684\u54cd\u5e94, \u611f\u8c22Nginx\u4e3a\u6211\u4eec\u9009\u62e9\u4e86 epoll and kqueue \u4f5c\u4e3a\u5f00\u53d1\u6a21\u578b\uff1b<br \/>\n\u5185\u5b58\u6d88\u8017\u5c11\uff1a\u57283\u4e07\u5e76\u53d1\u8fde\u63a5\u4e0b\uff0c\u5f00\u542f10\u4e2aNginx\u8fdb\u7a0b\u6d88\u8017150M\u5de6\u53f3\u5185\u5b58\uff0815M*10\uff09\uff1b<br \/>\n\u4e0d\u8981\u94b1\uff1aNginx\u4e3a\u5f00\u6e90\u8f6f\u4ef6\uff0c\u53ef\u4ee5\u514d\u8d39\u4f7f\u7528\u3002\u800c\u8d2d\u4e70F5 BIG-IP\u3001NetScaler\u7b49\u786c\u4ef6\u8d1f\u8f7d\u5747\u8861\u4ea4\u6362\u673a\u521a\u9700\u8981\u5341\u591a\u4e07\u81f3\u51e0\u5341\u4e07\u5143\u4eba\u6c11\u5e01\uff1b<br \/>\nNginx\u4f5c\u4e3a\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668: Nginx \u65e2\u53ef\u4ee5\u5728\u5185\u90e8\u76f4\u63a5\u652f\u6301 Rails \u548c PHP \u7a0b\u5e8f\u5bf9\u5916\u8fdb\u884c\u670d\u52a1, \u4e5f\u53ef\u4ee5\u652f\u6301\u4f5c\u4e3aHTTP\u4ee3\u7406 \u670d\u52a1\u5668\u5bf9\u5916\u8fdb\u884c\u670d\u52a1. Nginx\u91c7\u7528C\u8fdb\u884c\u7f16\u5199, \u4e0d\u8bba\u662f\u7cfb\u7edf\u8d44\u6e90\u5f00\u9500\u8fd8\u662fCPU\u4f7f\u7528\u6548\u7387\u90fd\u6bd4 Perlbal \u8981\u597d\u5f88\u591a\uff1b<br \/>\n\u4f5c\u4e3a\u90ae\u4ef6\u4ee3\u7406\u670d\u52a1\u5668: Nginx \u540c\u65f6\u4e5f\u662f\u4e00\u4e2a\u975e\u5e38\u4f18\u79c0\u7684\u90ae\u4ef6\u4ee3\u7406\u670d\u52a1\u5668\uff08\u6700\u65e9\u5f00\u53d1\u8fd9\u4e2a\u4ea7\u54c1\u7684\u76ee\u7684\u4e4b\u4e00\u4e5f\u662f\u4f5c\u4e3a\u90ae\u4ef6\u4ee3\u7406\u670d\u52a1\u5668\uff09,Last.fm\u63cf\u8ff0\u4e86\u6210\u529f\u5e76\u4e14\u7f8e\u5999\u7684\u4f7f\u7528\u7ecf\u9a8c\uff1b<br \/>\nNginx \u662f\u4e00\u4e2a [#installation \u5b89\u88c5] \u975e\u5e38\u7684\u7b80\u5355 ,\u914d\u7f6e\u6587\u4ef6?\u975e\u5e38\u7b80\u6d01\uff08\u8fd8\u80fd\u591f\u652f\u6301perl\u8bed\u6cd5\uff09,Bugs\u975e\u5e38\u5c11\u7684\u670d\u52a1\u5668: Nginx \u542f\u52a8\u7279\u522b\u5bb9\u6613, \u5e76\u4e14\u51e0\u4e4e\u53ef\u4ee5\u505a\u52307*24\u4e0d\u95f4\u65ad\u8fd0\u884c\uff0c\u5373\u4f7f\u8fd0\u884c\u6570\u4e2a\u6708\u4e5f\u4e0d\u9700\u8981\u91cd\u65b0\u542f\u52a8. \u4f60\u8fd8\u80fd\u591f\u4e0d\u95f4\u65ad\u670d\u52a1\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6f\u4ef6\u7248\u672c\u7684\u5347\u7ea7\uff1b<br \/>\n\u7a33\u5b9a\u6027\u9ad8\uff1a\u7528\u4e8e\u53cd\u5411\u4ee3\u7406\uff0c\u5b95\u673a\u7684\u6982\u7387\u5fae\u4e4e\u5176\u5fae\u3002<\/p>\n<p>4GB\u5185\u5b58\u7684\u670d\u52a1\u5668+Apache\uff08prefork\u6a21\u5f0f\uff09\u4e00\u822c\u53ea\u80fd\u5904\u74063000\u4e2a\u5e76\u53d1\u8fde\u63a5\uff0c\u56e0\u4e3a\u5b83\u4eec\u5c06\u5360\u75283GB\u4ee5\u4e0a\u7684\u5185\u5b58\uff0c\u8fd8\u5f97\u4e3a\u7cfb\u7edf\u9884\u75591GB\u7684\u5185\u5b58\u3002 Nginx 0.7.51 + PHP 5.2.8 (FastCGI) \u670d\u52a1\u5668\u57283\u4e07\u5e76\u53d1\u8fde\u63a5\u4e0b\uff0c\u5f00\u542f\u768410\u4e2aNginx\u8fdb\u7a0b\u6d88\u8017150M\u5185\u5b58\uff0815M*10=150M\uff09\uff0c\u5f00\u542f\u768464\u4e2aphp-cgi\u8fdb\u7a0b\u6d88\u80171280M\u5185\u5b58\uff0820M*64=1280M\uff09\uff0c\u52a0\u4e0a\u7cfb\u7edf\u81ea\u8eab\u6d88\u8017\u7684\u5185\u5b58\uff0c\u603b\u5171\u6d88\u8017\u4e0d\u52302GB\u5185\u5b58\u3002\u5982\u679c\u670d\u52a1\u5668\u5185\u5b58\u8f83\u5c0f\uff0c\u5b8c\u5168\u53ef\u4ee5\u53ea\u5f00\u542f25\u4e2aphp-cgi\u8fdb\u7a0b\uff0c\u8fd9\u6837php-cgi\u6d88\u8017\u7684\u603b\u5185\u5b58\u6570\u624d500M\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48Nginx\u7684\u6027\u80fd\u8981\u6bd4Apache\u9ad8\u5f97\u591a\uff1f\u8fd9\u5f97\u76ca\u4e8eNginx\u4f7f\u7528\u4e86\u6700\u65b0\u7684epoll\uff08Linux 2.6\u5185\u6838\uff09\u548ckqueue\uff08freebsd\uff09\u7f51\u7edcI\/O\u6a21\u578b\uff0c\u800cApache\u5219\u4f7f\u7528\u7684\u662f\u4f20\u7edf\u7684select\u6a21\u578b\u3002\u76ee\u524dLinux\u4e0b\u80fd\u591f\u627f\u53d7\u9ad8\u5e76\u53d1\u8bbf\u95ee\u7684Squid\u3001Memcached\u90fd\u91c7\u7528\u7684\u662fepoll\u7f51\u7edcI\/O\u6a21\u578b\u3002<\/p>\n<p>\u5904\u7406\u5927\u91cf\u7684\u8fde\u63a5\u7684\u8bfb\u5199\uff0cApache\u6240\u91c7\u7528\u7684select\u7f51\u7edcI\/O\u6a21\u578b\u975e\u5e38\u4f4e\u6548\u3002\u4e0b\u9762\u7528\u4e00\u4e2a\u6bd4\u55bb\u6765\u89e3\u6790Apache\u91c7\u7528\u7684select\u6a21\u578b\u548cNginx\u91c7\u7528\u7684epoll\u6a21\u578b\u8fdb\u884c\u4e4b\u95f4\u7684\u533a\u522b\uff1a<\/p>\n<p>\u5047\u8bbe\u4f60\u5728\u5927\u5b66\u8bfb\u4e66\uff0c\u4f4f\u7684\u5bbf\u820d\u697c\u6709\u5f88\u591a\u95f4\u623f\u95f4\uff0c\u4f60\u7684\u670b\u53cb\u8981\u6765\u627e\u4f60\u3002select\u7248\u697c\u7ba1\u5927\u5988\u5c31\u4f1a\u5e26\u7740\u4f60\u7684\u670b\u53cb\u6328\u4e2a\u623f\u95f4\u53bb\u627e\uff0c\u76f4\u5230\u627e\u5230\u4f60\u4e3a\u6b62\u3002\u800cepoll\u7248\u697c\u7ba1\u5927\u5988\u4f1a\u5148\u8bb0\u4e0b\u6bcf\u4f4d\u540c\u5b66\u7684\u623f\u95f4\u53f7\uff0c\u4f60\u7684\u670b\u53cb\u6765\u65f6\uff0c\u53ea\u9700\u544a\u8bc9\u4f60\u7684\u670b\u53cb\u4f60\u4f4f\u5728\u54ea\u4e2a\u623f\u95f4\u5373\u53ef\uff0c\u4e0d\u7528\u4eb2\u81ea\u5e26\u7740\u4f60\u7684\u670b\u53cb\u6ee1\u5927\u697c\u627e\u4eba\u3002\u5982\u679c\u6765\u4e8610000\u4e2a\u4eba\uff0c\u90fd\u8981\u627e\u81ea\u5df1\u4f4f\u8fd9\u680b\u697c\u7684\u540c\u5b66\u65f6\uff0cselect\u7248\u548cepoll\u7248\u697c\u7ba1\u5927\u5988\uff0c\u8c01\u7684\u6548\u7387\u66f4\u9ad8\uff0c\u4e0d\u8a00\u81ea\u660e\u3002\u540c\u7406\uff0c\u5728\u9ad8\u5e76\u53d1\u670d\u52a1\u5668\u4e2d\uff0c\u8f6e\u8be2I\/O\u662f\u6700\u8017\u65f6\u95f4\u7684\u64cd\u4f5c\u4e4b\u4e00\uff0cselect\u548cepoll\u7684\u6027\u80fd\u8c01\u7684\u6027\u80fd\u66f4\u9ad8\uff0c\u540c\u6837\u4e0d\u8a00\u81ea\u660e\u4e86\u3002<br \/>\n\u5b89\u88c5 FreeBSD7.2<\/p>\n<p>\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5efa\u8bae\u53c2\u8003FreeBSD Handbook\uff0c\u5728\u6b64\u4ec5\u7ed9\u51fa\u94fe\u63a5\uff0c\u4ee5\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u91cd\u590d\u52b3\u52a8\uff1a<\/p>\n<p>\u82f1\u6587\u7248<br \/>\nhttp:\/\/www.freebsd.org\/doc\/en_US.ISO8859-1\/books\/handbook\/install.html<br \/>\n\u4e2d\u6587\u7248<br \/>\nhttp:\/\/cnsnap.cn.freebsd.org\/doc\/zh_CN.GB2312\/books\/handbook\/install.html<\/p>\n<p>\u5b89\u88c5\u65f6\u7684\u6ce8\u610f\u4e8b\u9879<\/p>\n<p>1. \u78c1\u76d8\u5206\u533a<\/p>\n<p>\u7531\u4e8e\u662fWEB\u670d\u52a1\u7cfb\u7edf\uff0c\u7f51\u7ad9\u76ee\u5f55\u90fd\u653e\u4e8e\/home\u76ee\u5f55\u4e0b\uff0c\u56e0\u6b64home\u5206\u533a\u8981\u6709\u8db3\u591f\u7684\u7a7a\u95f4\u3002\u4ee5\u4e00\u5757\u786c\u76d8146G\/\u5185\u5b584G\u7684\u670d\u52a1\u5668\u4e3a\u4f8b\uff0c\u53ef\u505a\u5982\u4e0b\u5206\u533a\uff1a<\/p>\n<p>\/\u00a0 1024M<br \/>\nswap 4096M<br \/>\n\/var 10G<br \/>\n\/usr 20G<br \/>\n\/home 110G<br \/>\n\/tmp 1024M<\/p>\n<p>2. \u8f6f\u4ef6\u5305\u7684\u9009\u62e9<\/p>\n<p>\u6211\u4eec\u7684WEB\u670d\u52a1\u7cfb\u7edf\u662f\u8981\u5bf9\u5916\u670d\u52a1\u7684\uff0c\u6240\u4ee5\u5c3d\u53ef\u80fd\u5c11\u7684\u9009\u62e9\u8f6f\u4ef6\u5305\uff0c\u5b89\u88c5\u65f6\u5efa\u8bae\u9009\u62e9Minimal\uff0c\u7136\u540e\u8fdb\u5165Custom\u9009\u62e9doc\uff0cinfo\uff0cman\uff0csrc\u5373\u53ef\u3002<br \/>\n\u914d\u7f6e<\/p>\n<p>1. \u7f16\u8f91\/etc\/rc.conf\u786e\u4fdd\u6709\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<p>sshd_enable=&#8221;YES&#8221;<br \/>\nnamed_enable=&#8221;YES&#8221;<\/p>\n<p>2\uff0e\u6839\u636e\u786c\u4ef6\u7684\u914d\u7f6e\u91cd\u65b0\u7f16\u8bd1\u5185\u6838,\u7f16\u8bd1\u5185\u6838\u7684\u529e\u6cd5\u53c2\u8003FreeBSD Handbook,\u8fd9\u91cc\u53ea\u7ed9\u51fa\u94fe\u63a5:<\/p>\n<p>\u82f1\u6587\u7248<br \/>\nhttp:\/\/www.freebsd.org\/doc\/en_US.ISO8859-1\/books\/handbook\/kernelconfig.html<br \/>\n\u4e2d\u6587\u7248<br \/>\nhttp:\/\/cnsnap.cn.freebsd.org\/doc\/zh_CN.GB2312\/books\/handbook\/kernelconfig.html<\/p>\n<p>\u7f16\u8bd1\u540e\u7cfb\u7edf\u7684\u6027\u80fd\u5c06\u5f97\u5230\u8f83\u5927\u7684\u63d0\u5347\u3002<br \/>\n\u83b7\u53d6\u76f8\u5173\u5f00\u6e90\u8f6f\u4ef6\u5305<br \/>\n\u672c\u6587\u4e2d\u63d0\u5230\u7684\u6240\u6709\u5f00\u6e90\u8f6f\u4ef6\u5305\u4e3a\u622a\u6b62\u52302009\u5e7410\u670820\u65e5\u7684\u6700\u65b0\u7a33\u5b9a\u7248\uff0c\u4e14\u5747\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u3002<br \/>\nmkdir -p \/home\/software<br \/>\ncd \/home\/software<br \/>\nfetch http:\/\/sysoev.ru\/nginx\/nginx-0.8.24.tar.gz<br \/>\nfetch ftp:\/\/ftp.csx.cam.ac.uk\/pub\/software\/programming\/pcre\/pcre-8.00.tar.gz<br \/>\nfetch ftp:\/\/xmlsoft.org\/libxml2\/libxml2-2.7.6.tar.gz<br \/>\nfetch http:\/\/www.zlib.net\/zlib-1.2.3.tar.gz<br \/>\nfetch ftp:\/\/ftp.simplesystems.org\/pub\/libpng\/png\/src\/libpng-1.2.40.tar.gz<br \/>\nfetch http:\/\/www.ijg.org\/files\/jpegsrc.v7.tar.gz<br \/>\nfetch http:\/\/ftp.twaren.net\/Unix\/NonGNU\/freetype\/freetype-2.3.11.tar.gz<br \/>\nfetch http:\/\/www.libgd.org\/releases\/gd-2.0.35.tar.gz<br \/>\nfetch http:\/\/www.php.net\/get\/php-5.2.11.tar.gz\/from\/this\/mirror<br \/>\nfetch http:\/\/php-fpm.org\/downloads\/php-5.2.11-fpm-0.5.13.diff.gz<br \/>\nfetch http:\/\/ftp.gnu.org\/pub\/gnu\/libiconv\/libiconv-1.13.tar.gz<br \/>\n\u5b89\u88c5 Mysql5.1.40<br \/>\nMysql5.1.40 \u4e0b\u8f7d\u5730\u5740\uff1a http:\/\/dev.mysql.com\/get\/Downloads\/MySQL-5.1\/mysql-5.1.40.tar.gz\/from\/pick<br \/>\npw groupadd mysql<br \/>\npw useradd mysql -g mysql -d \/dev\/null -s \/sbin\/nologin<br \/>\ntar zxvf mysql-5.1.40.tar.gz<br \/>\ncd mysql-5.1.40<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/webserver\/mysql\/ &#8211;enable-assembler &#8211;with-extra-charsets=complex &#8211;enable-thread-safe-client &#8211;with-big-tables &#8211;with-readline &#8211;with-ssl &#8211;with-embedded-server &#8211;enable-local-infile &#8211;with-plugins=innobase<br \/>\nmake &amp;&amp; make install clean<br \/>\nchmod +w \/usr\/local\/webserver\/mysql<br \/>\nchown -R mysql:mysql \/usr\/local\/webserver\/mysql<br \/>\ncp \/usr\/local\/webserver\/mysql\/support-files\/my-medium.cnf \/usr\/local\/webserver\/mysql\/my.cnf<br \/>\ncd ..<\/p>\n<p>\u4ee5mysql\u7528\u6237\u5e10\u53f7\u7684\u8eab\u4efd\u5efa\u7acb\u6570\u636e\u8868<br \/>\n\/usr\/local\/webserver\/mysql\/bin\/mysql_install_db &#8211;datadir=\/usr\/local\/webserver\/mysql\/data &#8211;user=mysql<\/p>\n<p>\u521b\u5efa Mysql \u5f00\u673a\u542f\u52a8\u811a\u672c<br \/>\ncp \/usr\/local\/webserver\/mysql\/share\/mysql\/mysql.server \/usr\/local\/etc\/rc.d\/mysql.sh<\/p>\n<p>\u4e3a mysql.sh \u811a\u672c\u8bbe\u7f6e\u53ef\u6267\u884c\u5c5e\u6027<br \/>\nchmod +x \/usr\/local\/etc\/rc.d\/mysql.sh<\/p>\n<p>\u4fee\u6539 \/etc\/rc.conf<br \/>\nvi \/etc\/rc.conf<\/p>\n<p>\u52a0\u5165\u4ee5\u4e0b\u5185\u5bb9<br \/>\nmysql_enable=&#8221;YES&#8221;<\/p>\n<p>\u542f\u52a8 Mysql<br \/>\n\/usr\/local\/etc\/rc.d\/mysql.sh start<br \/>\n\u5b89\u88c5 Nginx<br \/>\n\u5b89\u88c5Nginx\u6240\u9700\u7684pcre\u5e93<br \/>\ntar zxvf pcre-8.00.tar.gz<br \/>\ncd pcre-8.00<br \/>\n.\/configure<br \/>\nmake &amp;&amp; make install clean<br \/>\ncd ..<br \/>\n\u5b89\u88c5 Nginx0.8.24<br \/>\ntar zxvf nginx-0.8.24.tar.gz<br \/>\ncd nginx-0.8.24<br \/>\n.\/configure &#8211;user=www &#8211;group=www &#8211;prefix=\/usr\/local\/webserver\/nginx &#8211;with-http_stub_status_module &#8211;with-http_ssl_module<br \/>\nmake &amp;&amp; make install clean<br \/>\ncd ..<br \/>\n\u521b\u5efa Nginx \u65e5\u5fd7\u76ee\u5f55<br \/>\nmkdir -p \/var\/log\/nginx<br \/>\nchmod +w \/var\/log\/nginx<br \/>\nchown -R www:www \/var\/log\/nginx<br \/>\n\u521b\u5efa Nginx \u914d\u7f6e\u6587\u4ef6<br \/>\nrm -f \/usr\/local\/webserver\/nginx\/conf\/nginx.conf<br \/>\nvi \/usr\/local\/webserver\/nginx\/conf\/nginx.conf<br \/>\n\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<p>user\u00a0 www www;<br \/>\nworker_processes 8;<\/p>\n<p>error_log\u00a0 \/var\/log\/nginx\/error.log;<br \/>\npid\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/var\/log\/nginx\/nginx.pid;<\/p>\n<p>worker_rlimit_nofile 51200;<br \/>\nevents {<br \/>\nuse kqueue;<br \/>\nworker_connections 51200;<br \/>\n}<\/p>\n<p>http {<br \/>\ninclude\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mime.types;<br \/>\ndefault_type\u00a0 application\/octet-stream;<\/p>\n<p>server_names_hash_bucket_size 128;<br \/>\nclient_header_buffer_size 32k;<br \/>\nlarge_client_header_buffers 4 32k;<br \/>\nclient_max_body_size 8m;<\/p>\n<p>sendfile\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on;<br \/>\ntcp_nopush\u00a0\u00a0\u00a0\u00a0 on;<\/p>\n<p>keepalive_timeout\u00a0 30;<\/p>\n<p>tcp_nodelay on;<\/p>\n<p>fastcgi_connect_timeout 300;<br \/>\nfastcgi_send_timeout 300;<br \/>\nfastcgi_read_timeout 300;<br \/>\nfastcgi_buffer_size 64k;<br \/>\nfastcgi_buffers 4 64k;<br \/>\nfastcgi_busy_buffers_size 128k;<br \/>\nfastcgi_temp_file_write_size 128k;<\/p>\n<p>gzip\u00a0 on;<br \/>\ngzip_min_length\u00a0\u00a0 1k;<br \/>\ngzip_buffers\u00a0\u00a0\u00a0\u00a0\u00a0 4 16k;<br \/>\ngzip_http_version 1.1;<br \/>\ngzip_comp_level\u00a0\u00a0 2;<br \/>\ngzip_types text\/plain application\/x-javascript text\/css application\/xml<br \/>\ngzip_vary on;<\/p>\n<p>server {<br \/>\nlisten\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 80;<br \/>\nserver_name\u00a0 localhost;<br \/>\nroot\u00a0\u00a0 \/home\/excms;<br \/>\nindex\u00a0 index.html index.htm index.php;<\/p>\n<p>location ~ \\.php$ {<br \/>\nfastcgi_pass\u00a0\u00a0 127.0.0.1:9000;<br \/>\nfastcgi_index\u00a0 index.php;<br \/>\nfastcgi_param\u00a0 SCRIPT_FILENAME\u00a0 $document_root$fastcgi_script_name;<br \/>\ninclude\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_params;<br \/>\n}<\/p>\n<p>location \/nginx_status {<br \/>\nstub_status on;<br \/>\naccess_log\u00a0\u00a0 off;<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p>\u521b\u5efa Nginx \u5f00\u673a\u542f\u52a8\u811a\u672c<br \/>\nvi \/usr\/local\/etc\/rc.d\/nginx.sh<\/p>\n<p>\u52a0\u5165\u4ee5\u4e0b\u5185\u5bb9<\/p>\n<p>#!\/bin\/sh<\/p>\n<p>nginx=\/usr\/local\/webserver\/nginx\/sbin\/nginx<br \/>\nconf=\/usr\/local\/webserver\/nginx\/conf\/nginx.conf<\/p>\n<p>case $1 in<br \/>\nstart)<br \/>\necho -n &#8220;Starting Nginx&#8221;<br \/>\n$nginx -c $conf<br \/>\necho &#8221; done&#8221;<br \/>\n;;<\/p>\n<p>stop)<br \/>\necho -n &#8220;Stopping Nginx&#8221;<br \/>\nkillall -9 nginx<br \/>\necho &#8221; done&#8221;<br \/>\n;;<\/p>\n<p>test)<br \/>\n$nginx -t -c $conf<br \/>\n;;<\/p>\n<p>reload)<br \/>\necho -n &#8220;Reloading Nginx&#8221;<br \/>\nps auxww | grep nginx | grep master | awk &#8216;{print $2}&#8217; | xargs kill -HUP<br \/>\necho &#8221; done&#8221;<br \/>\n;;<\/p>\n<p>restart)<br \/>\n$nginx stop<br \/>\n$nginx start<br \/>\n;;<\/p>\n<p>show)<br \/>\nps -aux|grep nginx<br \/>\n;;<\/p>\n<p>*)<br \/>\necho -n &#8220;Usage: $0 {start|restart|reload|stop|test|show}&#8221;<br \/>\n;;<\/p>\n<p>esac<\/p>\n<p>\u4e3a nginx.sh \u811a\u672c\u8bbe\u7f6e\u53ef\u6267\u884c\u5c5e\u6027<br \/>\nchmod +x \/usr\/local\/etc\/rc.d\/nginx.sh<\/p>\n<p>\u4fee\u6539 \/etc\/rc.conf<br \/>\nvi \/etc\/rc.conf<\/p>\n<p>\u52a0\u5165\u4ee5\u4e0b\u5185\u5bb9<br \/>\nnginx_enable=&#8221;YES&#8221;<\/p>\n<p>\u542f\u52a8 Nginx<br \/>\n\/usr\/local\/etc\/rc.d\/nginx.sh start<\/p>\n<p>\u5728\u4e0d\u505c\u6b62 Nginx \u670d\u52a1\u7684\u60c5\u51b5\u4e0b\u5e73\u6ed1\u53d8\u66f4 Nginx \u914d\u7f6e<br \/>\n\u4fee\u6539 \/usr\/local\/webserver\/nginx\/conf\/nginx.conf \u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u662f\u5426\u6b63\u786e\uff1a<br \/>\n\/usr\/local\/etc\/rc.d\/nginx.sh test<br \/>\n\u5982\u679c\u5c4f\u5e55\u663e\u793a\u4ee5\u4e0b\u4e24\u884c\u4fe1\u606f\uff0c\u8bf4\u660e\u914d\u7f6e\u6587\u4ef6\u6b63\u786e\uff1a<br \/>\nthe configuration file \/usr\/local\/webserver\/nginx\/conf\/nginx.conf syntax is ok<br \/>\nthe configuration file \/usr\/local\/webserver\/nginx\/conf\/nginx.conf was tested successfully<\/p>\n<p>\u5e73\u6ed1\u53d8\u66f4 Nginx \u914d\u7f6e<br \/>\n\/usr\/local\/etc\/rc.d\/nginx.sh reload<br \/>\n\u5b89\u88c5 GD<br \/>\n\u5b89\u88c5 zlib<\/p>\n<p>tar zxvf zlib-1.2.3.tar.gz<br \/>\ncd zlib-1.2.3<br \/>\n.\/configure<br \/>\nmake &amp;&amp; make install clean<br \/>\ncd ..<\/p>\n<p>\u5b89\u88c5 libpng<\/p>\n<p>tar zxvf libpng-1.2.40.tar.gz<br \/>\ncd libpng-1.2.40<br \/>\n.\/configure<br \/>\nmake &amp;&amp; make install clean<br \/>\ncd ..<\/p>\n<p>\u5b89\u88c5 jpeg<\/p>\n<p>tar zxvf jpegsrc.v7.tar.gz<br \/>\ncd jpeg-7<br \/>\n.\/configure \u2013prefix=\/usr\/local\/jpeg7 -enable-shared -enable-static<br \/>\nmake &amp;&amp; make install clean<br \/>\ncd ..<\/p>\n<p>\u5b89\u88c5 freetype<\/p>\n<p>tar zxvf freetype-2.3.11.tar.gz<br \/>\ncd freetype-2.3.11<br \/>\n.\/configure<br \/>\nmake &amp;&amp; make install clean<br \/>\ncd ..<\/p>\n<p>\u5b89\u88c5 gd2.0.35<\/p>\n<p>tar zxvf gd-2.0.35.tar.gz<br \/>\ncd gd-2.0.35<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/gd2 &#8211;with-jpeg=\/usr\/local\/jpeg7 &#8211;width-png &#8211;width-zlib &#8211;width-freetype<br \/>\nmake &amp;&amp; make install clean<br \/>\ncd ..<\/p>\n<p>\u5b89\u88c5 libxml2<\/p>\n<p>tar -zxvf libxml2-2.7.6.tar.gz<br \/>\ncd libxml2-2.7.6<br \/>\n.\/configure<br \/>\nmake &amp;&amp; make install clean<br \/>\ncd ..<\/p>\n<p>\u5b89\u88c5 PHP5.2.11<br \/>\n\u7f16\u8bd1\u5b89\u88c5PHP 5.2.11\u6240\u9700\u7684\u652f\u6301\u5e93 libiconv<br \/>\ntar zxvf libiconv-1.13.tar.gz<br \/>\ncd libiconv-1.13<br \/>\n.\/configure &#8211;prefix=\/usr\/local<br \/>\nmake &amp;&amp; make install clean<br \/>\ncd ..<br \/>\n\u7f16\u8bd1\u5b89\u88c5PHP\uff08FastCGI\u6a21\u5f0f\uff09<br \/>\ntar zxvf php-5.2.11.tar.gz<br \/>\ngzip -cd php-5.2.11-fpm-0.5.13.diff.gz | patch -d php-5.2.11 -p1<br \/>\ncd php-5.2.11<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/webserver\/php &#8211;with-config-file-path=\/usr\/local\/webserver\/php\/etc &#8211;with-mysql=\/usr\/local\/webserver\/mysql &#8211;with-iconv-dir &#8211;with-freetype-dir &#8211;with-jpeg-dir &#8211;with-png-dir &#8211;with-zlib &#8211;with-gd &#8211;enable-gd-native-ttf &#8211;with-libxml-dir &#8211;enable-xml &#8211;disable-rpath &#8211;enable-discard-path &#8211;enable-safe-mode &#8211;enable-bcmath &#8211;enable-shmop &#8211;enable-sysvsem &#8211;enable-inline-optimization &#8211;with-curlwrappers &#8211;enable-mbregex &#8211;enable-fastcgi &#8211;enable-fpm &#8211;enable-force-cgi-redirect &#8211;enable-mbstring &#8211;with-openssl &#8211;enable-pcntl &#8211;enable-sockets<br \/>\nmake ZEND_EXTRA_LIBS=&#8217;-liconv&#8217;<br \/>\nmake install clean<br \/>\ncp php.ini-dist \/usr\/local\/webserver\/php\/etc\/php.ini<br \/>\ncd ..<br \/>\n\u5b89\u88c5 ZendOptimizer<br \/>\nZendOptimizer \u5b98\u65b9\u4e0b\u8f7d\u5730\u5740\uff1a http:\/\/www.zend.com\/en\/products\/guard\/downloads<\/p>\n<p>tar zxvf ZendOptimizer-3.3.9-freebsd6.0-i386.tar.gz<br \/>\ncd ZendOptimizer-3.3.3-freebsd6.0-i386<br \/>\nln -s \/usr\/lib\/libc.so \/usr\/lib\/libc.so.6<br \/>\nln -s \/usr\/lib\/libcrypt.so \/usr\/lib\/libcrypt.so.3<br \/>\nln -s \/usr\/lib\/libutil.so \/usr\/lib\/libutil.so.5<br \/>\nln -s \/usr\/lib\/libm.so \/usr\/lib\/libm.so.4<br \/>\n.\/install-tty<br \/>\ncd ..<\/p>\n<p>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u7684\u63d0\u793a\u5168\u9ed8\u8ba4\u5c31\u53ef\u4ee5\uff0c\u6307\u5b9aphp.ini\u6587\u4ef6\u8def\u5f84 \/usr\/local\/webserver\/php\/etc\uff0c\u5230Apache Web Server\u9009no<br \/>\n\u4fee\u6539php-fpm\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>php-fpm\u662f\u4e3aPHP\u6253\u7684\u4e00\u4e2aFastCGI\u7ba1\u7406\u8865\u4e01\uff0c\u53ef\u4ee5\u5e73\u6ed1\u53d8\u66f4php.ini\u914d\u7f6e\u800c\u65e0\u9700\u91cd\u542fphp-cgi<\/p>\n<p>vi \/usr\/local\/webserver\/php\/etc\/php-fpm.conf<\/p>\n<p>\u5c06 &lt;value name=&#8221;user&#8221;&gt;nobody&lt;\/value&gt;\u548c &lt;value name=&#8221;group&#8221;&gt;nobody&lt;\/value&gt; \u4e2d\u7684 nobody \u6539\u4e3a www, \u5e76\u53bb\u6389\u524d\u540e\u7684\u6ce8\u91ca\u6807\u7b7e &lt;!&#8211; , &#8211;&gt;\uff1b<br \/>\n\u5982\u8981\u663e\u793aPHP\u8c03\u8bd5\u7684\u9519\u8bef\u4fe1\u606f\u5c06 &lt;value name=&#8221;display_errors&#8221;&gt;0&lt;\/value&gt; \u4fee\u6539\u4e3a &lt;value name=&#8221;display_errors&#8221;&gt;1&lt;\/value&gt; \uff0c\u5e76\u53bb\u6389\u524d\u540e\u7684\u6ce8\u91ca\u6807\u7b7e &lt;!&#8211; , &#8211;&gt;, \u4ee5\u663e\u793aPHP\u9519\u8bef\u4fe1\u606f\uff0c\u5426\u5219\uff0cNginx \u4f1a\u62a5\u72b6\u6001\u4e3a500\u7684\u7a7a\u767d\u9519\u8bef\u9875\u3002<br \/>\n\u521b\u5efa PHP-fpm \u5f00\u673a\u542f\u52a8\u811a\u672c<br \/>\nvi \/usr\/local\/etc\/rc.d\/php-fpm.sh<\/p>\n<p>\u52a0\u5165\u4ee5\u4e0b\u5185\u5bb9<\/p>\n<p>#! \/bin\/sh<\/p>\n<p>php_fpm_BIN=\/usr\/local\/webserver\/php\/bin\/php-cgi<br \/>\nphp_fpm_CONF=\/usr\/local\/webserver\/php\/etc\/php-fpm.conf<br \/>\nphp_fpm_PID=\/usr\/local\/webserver\/php\/logs\/php-fpm.pid<\/p>\n<p>php_opts=&#8221;&#8211;fpm-config $php_fpm_CONF&#8221;<\/p>\n<p>wait_for_pid () {<br \/>\ntry=0<\/p>\n<p>while test $try -lt 35 ; do<\/p>\n<p>case &#8220;$1&#8221; in<br \/>\n&#8216;created&#8217;)<br \/>\nif [ -f &#8220;$2&#8243; ] ; then<br \/>\ntry=&#8221;<br \/>\nbreak<br \/>\nfi<br \/>\n;;<\/p>\n<p>&#8216;removed&#8217;)<br \/>\nif [ ! -f &#8220;$2&#8243; ] ; then<br \/>\ntry=&#8221;<br \/>\nbreak<br \/>\nfi<br \/>\n;;<br \/>\nesac<\/p>\n<p>echo -n .<br \/>\ntry=`expr $try + 1`<br \/>\nsleep 1<\/p>\n<p>done<\/p>\n<p>}<\/p>\n<p>case &#8220;$1&#8221; in<br \/>\nstart)<br \/>\necho -n &#8220;Starting php_fpm &#8221;<\/p>\n<p>$php_fpm_BIN &#8211;fpm $php_opts<\/p>\n<p>if [ &#8220;$?&#8221; != 0 ] ; then<br \/>\necho &#8221; failed&#8221;<br \/>\nexit 1<br \/>\nfi<\/p>\n<p>wait_for_pid created $php_fpm_PID<\/p>\n<p>if [ -n &#8220;$try&#8221; ] ; then<br \/>\necho &#8221; failed&#8221;<br \/>\nexit 1<br \/>\nelse<br \/>\necho &#8221; done&#8221;<br \/>\nfi<br \/>\n;;<\/p>\n<p>stop)<br \/>\necho -n &#8220;Shutting down php_fpm &#8221;<\/p>\n<p>if [ ! -r $php_fpm_PID ] ; then<br \/>\necho &#8220;warning, no pid file found &#8211; php-fpm is not running ?&#8221;<br \/>\nexit 1<br \/>\nfi<\/p>\n<p>kill -TERM `cat $php_fpm_PID`<\/p>\n<p>wait_for_pid removed $php_fpm_PID<\/p>\n<p>if [ -n &#8220;$try&#8221; ] ; then<br \/>\necho &#8221; failed&#8221;<br \/>\nexit 1<br \/>\nelse<br \/>\necho &#8221; done&#8221;<br \/>\nfi<br \/>\n;;<\/p>\n<p>quit)<br \/>\necho -n &#8220;Gracefully shutting down php_fpm &#8221;<\/p>\n<p>if [ ! -r $php_fpm_PID ] ; then<br \/>\necho &#8220;warning, no pid file found &#8211; php-fpm is not running ?&#8221;<br \/>\nexit 1<br \/>\nfi<\/p>\n<p>kill -QUIT `cat $php_fpm_PID`<\/p>\n<p>wait_for_pid removed $php_fpm_PID<\/p>\n<p>if [ -n &#8220;$try&#8221; ] ; then<br \/>\necho &#8221; failed&#8221;<br \/>\nexit 1<br \/>\nelse<br \/>\necho &#8221; done&#8221;<br \/>\nfi<br \/>\n;;<\/p>\n<p>restart)<br \/>\n$0 stop<br \/>\n$0 start<br \/>\n;;<\/p>\n<p>reload)<\/p>\n<p>echo -n &#8220;Reload service php-fpm &#8221;<\/p>\n<p>if [ ! -r $php_fpm_PID ] ; then<br \/>\necho &#8220;warning, no pid file found &#8211; php-fpm is not running ?&#8221;<br \/>\nexit 1<br \/>\nfi<\/p>\n<p>kill -USR2 `cat $php_fpm_PID`<\/p>\n<p>echo &#8221; done&#8221;<br \/>\n;;<\/p>\n<p>logrotate)<\/p>\n<p>echo -n &#8220;Re-opening php-fpm log file &#8221;<\/p>\n<p>if [ ! -r $php_fpm_PID ] ; then<br \/>\necho &#8220;warning, no pid file found &#8211; php-fpm is not running ?&#8221;<br \/>\nexit 1<br \/>\nfi<\/p>\n<p>kill -USR1 `cat $php_fpm_PID`<\/p>\n<p>echo &#8221; done&#8221;<br \/>\n;;<\/p>\n<p>*)<br \/>\necho &#8220;Usage: $0 {start|stop|quit|restart|reload|logrotate}&#8221;<br \/>\nexit 1<br \/>\n;;<\/p>\n<p>esac<\/p>\n<p>\u4e3a php-fpm.sh \u811a\u672c\u8bbe\u7f6e\u53ef\u6267\u884c\u5c5e\u6027<br \/>\nchmod +x \/usr\/local\/etc\/rc.d\/php-fpm.sh<\/p>\n<p>\u4fee\u6539 \/etc\/rc.conf<br \/>\nvi \/etc\/rc.conf<\/p>\n<p>\u52a0\u5165\u4ee5\u4e0b\u5185\u5bb9<br \/>\nphp_fpm_enable=&#8221;YES&#8221;<\/p>\n<p>\u542f\u52a8 PHP-fpm<br \/>\n\/usr\/local\/etc\/rc.d\/php-fpm.sh start<\/p>\n<p>\u5728\u4e0d\u505c\u6b62 PHP-fpm \u670d\u52a1\u7684\u60c5\u51b5\u4e0b\u5e73\u6ed1\u53d8\u66f4 php.ini \u914d\u7f6e<br \/>\n\u4fee\u6539 \/usr\/local\/webserver\/php\/etc\/php.ini \u6216\u8005 \/usr\/loca\/webserver\/php\/etc\/php-fpm.conf \u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u662f\u5426\u6b63\u786e\uff1a<br \/>\n\/usr\/local\/etc\/rc.d\/php-fpm.sh reload<br \/>\n\u6d4b\u8bd5<\/p>\n<p>\u5728\/home\/excms \u76ee\u5f55\u4e0b\u65b0\u5efa phpinfo.php<br \/>\nvi \/home\/excms\/phpinfo.php<\/p>\n<p>\u52a0\u5165\u5982\u4e0b\u6587\u672c<\/p>\n<p>&lt;?<br \/>\nphpinfo();<br \/>\n?&gt;<\/p>\n<p>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u5728\u5730\u5740\u680f\u91cc\u8f93\u5165 http:\/\/\u60a8\u670d\u52a1\u5668\u7684IP\/phpinfo.php<br \/>\n\u7cfb\u7edf\u4f18\u5316<\/p>\n<p>\u4fee\u6539\u5185\u6838\u53c2\u6570\uff0c\u7f16\u8f91 \/boot\/loader.conf<br \/>\nvi \/boot\/loader.conf<\/p>\n<p>\u52a0\u5165\u5982\u4e0b\u6587\u672c<\/p>\n<p>kern.dfldsiz=&#8221;2147483648&#8243;\u00a0 # Set the initial data size limit<br \/>\nkern.maxdsiz=&#8221;2147483648&#8243;\u00a0 # Set the max data size<br \/>\nkern.ipc.nmbclusters=&#8221;0&#8243;\u00a0\u00a0 # Set the number of mbuf clusters<br \/>\nkern.ipc.nsfbufs=&#8221;66560&#8243;\u00a0\u00a0 # Set the number of sendfile(2) bufs<\/p>\n<p>\u89e3\u91ca\uff1a a\uff0e\u7b2c\u4e00\uff0c\u7b2c\u4e8c\u884c\u4e3b\u8981\u662f\u4e3a\u4e86\u7a81\u78341G\u5185\u5b58\u8bbe\u7f6e\u7684 b\uff0e \u7b2c\u4e09\u884c\u5176\u5b9e\u662fbsd\u7684\u4e00\u4e2abug\uff0c\u5f53\u7cfb\u7edf\u5e76\u53d1\u8fbe\u5230\u4e00\u4e2a\u6570\u91cf\u7ea7\u7684\u65f6\u5019\uff0c\u7cfb\u7edf\u4f1acrash\uff0c\u8fd9\u4e2a\u662f\u975e\u5e38\u7cdf\u7cd5\u7684\u4e8b\u60c5\uff0c\u6240\u5e78\u66f4\u6539\u4e86\u8fd9\u4e2a\u53c2\u6570\u540e\uff0c\u5728\u9ad8\u5e76\u53d1\u7684\u65f6\u5019\uff0c\u57fa\u672c\u53ef\u4ee5\u6ca1\u6709\u7c7b\u4f3c\u60c5\u51b5\uff0c\u5f53\u7136\u975e\u5e38bt\u7684\u60c5\u51b5\uff0c\u8fd8\u5f97\u8fdb\u4e00\u6b65\u60f3\u529e\u6cd5 c\uff0e\u7b2c\u56db\u884c\u662f\u8bfb\u53d6\u7684\u6587\u4ef6\u6570\uff0c\u5982\u679c\u4f60\u4e0b\u8f7d\u7684\u6587\u4ef6\u6bd4\u8f83\u5927\uff0c\u4e14\u6bd4\u8f83\u591a\uff0c\u52a0\u5927\u8fd9\u4e2a\u53c2\u6570\uff0c\u662f\u975e\u5e38\u723d\u7684<br \/>\n\u9632ddos\u653b\u51fb<br \/>\nSysctl \u4fee\u6539<br \/>\nvi \/etc\/rc.local<\/p>\n<p>\u52a0\u5165\u5982\u4e0b\u6587\u672c<\/p>\n<p>sysctl kern.ipc.maxsockets=100000\u00a0 ##\u589e\u52a0\u5e76\u53d1\u7684socket\uff0c\u5bf9\u4e8eddos\u5f88\u6709\u7528<br \/>\nsysctl kern.ipc.somaxconn=65535\u00a0 ##\u6253\u5f00\u6587\u4ef6\u6570<br \/>\nsysctl net.inet.tcp.msl=2500\u00a0\u00a0 ##timeout\u65f6\u95f4<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00\uff1a\u672c\u6587\u662f\u5173\u4e8e\u5982\u4f55\u642d\u5efa\u57fa\u4e8e\u201cFreeBSD7.2 + Nginx0&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-117","post","type-post","status-publish","format-standard","hentry","category-freebsd-"],"_links":{"self":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=117"}],"version-history":[{"count":1,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/117\/revisions"}],"predecessor-version":[{"id":118,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/117\/revisions\/118"}],"wp:attachment":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}