{"id":299,"date":"2014-02-07T01:07:37","date_gmt":"2014-02-06T16:07:37","guid":{"rendered":"http:\/\/tech.akat.info\/?p=299"},"modified":"2015-01-03T00:30:22","modified_gmt":"2015-01-02T15:30:22","slug":"wheezy-nginx-php-fpm","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=299","title":{"rendered":"php-fpm\uff06nginx"},"content":{"rendered":"<h1>php-fpm<\/h1>\n<p>fpm(FastCGI Process Manager)\u306f\u3001php-cgi\u306e\u30d7\u30ed\u30bb\u30b9\u7ba1\u7406\u304c\u3067\u304d\u308b<br \/>\nPHP5.4.0\u304b\u3089\u516c\u5f0f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\u30ed\u30f3\u30b0\u30b5\u30dd\u30fc\u30c8\u304c\u671f\u5f85\u3067\u304d\u308b<\/p>\n<h2>\u3067\u304d\u308b\u3053\u3068<\/h2>\n<p>\u30fb\u7de9\u3084\u304b\u306a (graceful) \u505c\u6b62\/\u8d77\u52d5 \u6a5f\u80fd\u3092\u542b\u3080\u9ad8\u5ea6\u306a\u30d7\u30ed\u30bb\u30b9\u7ba1\u7406<br \/>\n\u30fb\u7570\u306a\u308b uid\/gid\/chroot\/environment \u3067\u306e\u30ef\u30fc\u30ab\u30fc\u306e\u958b\u59cb\u3001 \u7570\u306a\u308b\u30dd\u30fc\u30c8\u3067\u306e\u30ea\u30b9\u30f3\u3001\u7570\u306a\u308b php.ini \u306e\u4f7f\u7528 (safe_mode \u306e\u4ee3\u66ff)<br \/>\n\u30fb\u6a19\u6e96\u51fa\u529b\u304a\u3088\u3073\u6a19\u6e96\u30a8\u30e9\u30fc\u51fa\u529b\u3078\u306e\u30ed\u30b0\u51fa\u529b<br \/>\n\u30fbopcode \u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u58ca\u308c\u305f\u5834\u5408\u306e\u7dca\u6025\u518d\u8d77\u52d5<br \/>\n\u30fb&#8221;slowlog&#8221; &#8211; \u975e\u5e38\u306b\u4f4e\u901f\u306b\u52d5\u4f5c\u3059\u308b\u30ed\u30b0\u51fa\u529b\u30b9\u30af\u30ea\u30d7\u30c8 (\u540d\u524d\u304b\u3089\u60f3\u50cf\u3055\u308c\u308b\u5185\u5bb9\u3060\u3051\u3067\u306a\u304f\u3001ptrace \u3084\u305d\u308c\u3068\u540c\u7b49\u306e\u4ed5\u7d44\u307f\u3092\u4f7f\u3063\u3066\u30ea\u30e2\u30fc\u30c8\u30d7\u30ed\u30bb\u30b9\u306e execute_data \u304b\u3089\u306e PHP \u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3082\u51fa\u529b\u3057\u307e\u3059)<br \/>\n\u30fb\u52d5\u7684\/\u9759\u7684 \u306a\u5b50\u30d7\u30ed\u30bb\u30b9\u306e\u8d77\u52d5<br \/>\n\u30fb\u57fa\u672c\u7684\u306a SAPI \u306e\u52d5\u4f5c\u72b6\u6cc1 (Apache \u306e mod_status \u3068\u540c\u7b49)<br \/>\n\u30fbfastcgi_finish_request() &#8211; \u30ea\u30af\u30a8\u30b9\u30c8\u3092\u7d42\u308f\u3089\u305b\u3066\u3059\u3079\u3066\u306e\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3057\u305f\u5f8c\u3067 \u4f55\u304b\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406 (\u52d5\u753b\u306e\u5909\u63db\u3084\u7d71\u8a08\u60c5\u5831\u306e\u51e6\u7406\u306a\u3069) \u3092\u3055\u305b\u308b\u305f\u3081\u306e\u7279\u6b8a\u306a\u95a2\u6570<\/p>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u7c21\u5358\u306a\u64cd\u4f5c<\/h2>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@akat:\/home\/akat# uname -a\r\nLinux www27032ue 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU\/Linux\r\nroot@akat:\/home\/akat# aptitude install php5-fpm\r\n\u2026\u4e2d\u7565\r\nroot@akat:\/home\/akat# php5-fpm -v\r\nPHP 5.4.4-14+deb7u7 (fpm-fcgi) (built: Dec 12 2013 08:42:33)\r\nCopyright (c) 1997-2009 The PHP Group\r\nZend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies\r\nroot@akat:\/home\/akat# php5-fpm -i # PHP\u60c5\u5831\u3084\u8a2d\u5b9a\u3092\u8868\u793a\r\nphpinfo()\r\nPHP Version =&gt; 5.4.4-14+deb7u7\r\n\r\nSystem =&gt; Linux www27032ue 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64\r\nBuild Date =&gt; Dec 12 2013 08:40:58\r\nServer API =&gt; FPM\/FastCGI\r\nVirtual Directory Support =&gt; disabled\r\nConfiguration File (php.ini) Path =&gt; \/etc\/php5\/fpm\r\nLoaded Configuration File =&gt; \/etc\/php5\/fpm\/php.ini\r\n\u2026\u4e2d\u7565\r\nroot@akat:\/home\/akat# php5-fpm -m # \u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u8868\u793a\r\n&#x5B;PHP Modules]\r\nbcmath\r\nbz2\r\ncalendar\r\ncgi-fcgi\r\nCore\r\nctype\r\ndate\r\n\u2026\u4e2d\u7565\r\nroot@www27032ue:\/home\/shimizu# php5-fpm -t # \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u78ba\u8a8d\r\n&#x5B;11-Feb-2014 20:03:49] NOTICE: configuration file \/etc\/php5\/fpm\/php-fpm.conf test is successful\r\n\r\n<\/pre>\n<h1>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb-\/etc\/php5\/fpm\/php-fpm.conf<\/h1>\n<h2>pid = \/var\/run\/php5-fpm.pid<\/h2>\n<p>pid\u30d5\u30a1\u30a4\u30eb<\/p>\n<h2>emergency_restart_threshold\u3001emergency_restart_interval<\/h2>\n<p>emergency_restart_threshold\u500b\u4ee5\u4e0a\u306e\u5b50\u30d7\u30ed\u30bb\u30b9\u304c\u3001emergency_restart_interval\u306e\u9593\u306bSIGSEGV\u3082\u3057\u304f\u306fSIGBUS\u3068\u306a\u3063\u305f\u3068\u304dFPM\u306f\u518d\u8d77\u52d5\u3059\u308b<br \/>\n0\u3068\u3057\u305f\u3068\u304d\u306f\u3001\u7121\u52b9\u3067\u3042\u308b\u3053\u3068\u3092\u8868\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u7121\u52b9<\/p>\n<h2>process_control_timeout<\/h2>\n<p>\u5b50\u30d7\u30ed\u30bb\u30b9\u304cmaster\u304b\u3089\u306eSIGNAL\u3092\u5f85\u3064\u6700\u5927\u6642\u9593<br \/>\n\u79d2\u6570\u3001\u5206\u3001\u6642\u9593\u3001\u65e5\u3067\u6307\u5b9a\u3059\u308b\u3053\u3068\u3068\u304c\u53ef\u80fd<\/p>\n<h2>process.max<\/h2>\n<p>FPM\u304c\u30d5\u30a9\u30fc\u30af\u3059\u308b\u6700\u5927\u30d7\u30ed\u30bb\u30b9\u6570<br \/>\n\u591a\u304f\u306e\u30d7\u30fc\u30eb\u3092\u5229\u7528\u3057\u3066dynamic PM\u3092\u4f7f\u3046\u3068\u304d\u3001\u30d7\u30ed\u30bb\u30b9\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3059\u308b\u8a2d\u5b9a\u3068\u306a\u308b<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f0\u3067\u3001\u5236\u9650\u306a\u3057<\/p>\n<h2>process.priority<\/h2>\n<p>master\u30d7\u30ed\u30bb\u30b9\u306e\u30ca\u30a4\u30b9\u5024\u3092\u8a2d\u5b9a\u3059\u308b<br \/>\n-19 (\u3082\u3063\u3068\u3082\u512a\u5148\u5ea6\u9ad8\u3044) to 20(\u3082\u3063\u3068\u3082\u512a\u5148\u5ea6\u304c\u4f4e\u3044)\u3092\u8a2d\u5b9a\u3067\u304d\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u8a2d\u5b9a\u3057\u3066\u3044\u306a\u3044<\/p>\n<h2>daemonize<\/h2>\n<p>FPM \u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u306b\u9001\u308b\u3002\u30c7\u30d0\u30c3\u30af\u3059\u308b\u305f\u3081\u306b\u306fno\u3068\u3059\u308b\u3079\u3057<\/p>\n<h2>rlimit_files<\/h2>\n<p>master\u30d7\u30ed\u30bb\u30b9\u306e\u30aa\u30fc\u30d7\u30f3\u3067\u304d\u308b\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u6570\u3092\u6307\u5b9a\u3059\u308b<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u30b7\u30b9\u30c6\u30e0\u306e\u898f\u5b9a\u5024<\/p>\n<h2>rlimit_core<\/h2>\n<p>master\u30d7\u30ed\u30bb\u30b9\u306e\u30b3\u30a2\u30b5\u30a4\u30ba\u306e\u5236\u9650\u3092\u6307\u5b9a\u3059\u308b<br \/>\n\u6307\u5b9a\u3067\u304d\u308b\u306e\u306f\u3001unlimited\u3001\u3082\u3057\u304f\u306f0\u4ee5\u4e0a\u306e\u6574\u6570<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u30b7\u30b9\u30c6\u30e0\u306e\u898f\u5b9a\u5024<\/p>\n<h2>events.mechanism<\/h2>\n<p>FPM\u306e\u5185\u90e8\u30e1\u30ab\u30cb\u30ba\u30e0\u3092\u9078\u629e\u3059\u308b<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u81ea\u52d5\u3067\u9078\u629e\u3059\u308b<br \/>\nlinux\u306fepoll\u304c\u3088\u3044<\/p>\n<h1>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb-\/etc\/php5\/fpm\/pool.d\/www.conf<\/h1>\n<h2>\u6982\u8981<\/h2>\n<p>\u5b50\u30d7\u30ed\u30bb\u30b9\u306e\u7ba1\u7406\u3059\u308b\u30d7\u30fc\u30eb\u306f\u305d\u308c\u305e\u308c\u5225\u306e\u30dd\u30fc\u30c8\u3084\u8a2d\u5b9a\u3067\u8d77\u52d5\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd<br \/>\nphp.ini\u306e\u4e0a\u66f8\u304d\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b<br \/>\n\u30d7\u30fc\u30eb\u540d\u306flog\u3084stats\u306b\u5229\u7528\u3055\u308c\u308b\u3001\u307e\u305f\u30d7\u30fc\u30eb\u306e\u6570\u306b\u5236\u9650\u306f\u306a\u3044<\/p>\n<h2>[www]<\/h2>\n<p>pool\u540d\u3092\u6307\u5b9a\u3059\u308b<br \/>\n\u5909\u6570$pool\u306f\u3053\u3053\u3067\u6307\u5b9a\u3059\u308b<\/p>\n<h2>user,group<\/h2>\n<p>\u30d7\u30ed\u30bb\u30b9\u3092\u6240\u6709\u3059\u308b\u30e6\u30fc\u30b6\u3068\u30b0\u30eb\u30fc\u30d7<\/p>\n<h2>listen<\/h2>\n<p>FastCGI\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u5f85\u3061\u53d7\u3051\u308b\u30dd\u30fc\u30c8\u3084\u30bd\u30b1\u30c3\u30c8\u3092\u8a2d\u5b9a\u3059\u308b<br \/>\n\u4f8b:<br \/>\nlisten = \/var\/run\/php5-fpm.sock<br \/>\nlisten = 127.0.0.1:9000<\/p>\n<h2>listen.backlog\u2605<\/h2>\n<p>listen(2) \u306ebacklog\u306e\u8a2d\u5b9a\u3002\u30c7\u30d5\u30a9\u30eb\u30c8128<\/p>\n<h2>listen.owner,listen.group,listen.mode<\/h2>\n<p>Unix\u30bd\u30b1\u30c3\u30c8\u3092\u5229\u7528\u3059\u308b\u3068\u304d\u306eown\u30e6\u30fc\u30b6\u3084\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b<\/p>\n<h2>listen.allowed_clients<\/h2>\n<p>FastCGI\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u63a5\u7d9a\u3092IP\u5236\u9650\u3059\u308b<br \/>\n\u30a2\u30c9\u30ec\u30b9\u306f\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u6307\u5b9a\u3057\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u3059\u3079\u3066\u306e\u63a5\u7d9a\u3092\u53d7\u3051\u4ed8\u3051\u308b<\/p>\n<h2>priority<\/h2>\n<p>pool\u30d7\u30ed\u30bb\u30b9\u306e\u30ca\u30a4\u30b9\u5024\u3092\u8a2d\u5b9a\u3059\u308b<br \/>\n-19 (\u3082\u3063\u3068\u3082\u512a\u5148\u5ea6\u9ad8\u3044) to 20(\u3082\u3063\u3068\u3082\u512a\u5148\u5ea6\u304c\u4f4e\u3044)\u3092\u8a2d\u5b9a\u3067\u304d\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u8a2d\u5b9a\u3057\u3066\u3044\u306a\u3044<\/p>\n<h2>pm<\/h2>\n<p>\u5b50\u30d7\u30ed\u30bb\u30b9\u306e\u7ba1\u7406\u65b9\u6cd5\u3092\u6307\u5b9a\u3059\u308b<br \/>\nstatic,dynamic,ondemand\u304b\u3089\u9078\u629e\u53ef\u80fd<\/p>\n<h2><\/h2>\n<h2><\/h2>\n<h2>pm.status_path<\/h2>\n<p>FPM\u306estatus\u3092\u95b2\u89a7\u3067\u304d\u308bURI\u3092\u6307\u5b9a\u3059\u308b<br \/>\npool\u540d\u306a\u3069\u306e\u8a2d\u5b9a\u304b\u3089\u73fe\u5728\u306e\u63a5\u7d9a\u6570\u306a\u3069\u78ba\u8a8d\u53ef\u80fd<\/p>\n<p>\u901a\u5e38\u30c6\u30ad\u30b9\u30c8\u3067\u4e00\u90e8\u60c5\u5831\u3060\u3051\u8868\u793a\u3055\u308c\u308b\u304c\u3001<br \/>\nhttp:\/\/www.foo.bar\/status?html&#038;full<br \/>\n\u306a\u3069\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001html\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3079\u3066\u306e\u60c5\u5831\u3092\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd<\/p>\n<h2>ping.response<\/h2>\n<p>ping\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u53ef\u80fd<br \/>\n\u30ec\u30b9\u30dd\u30f3\u30b9\u30b3\u30fc\u30c9200\u306etext\/plain\u5f62\u5f0f\u3067\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3055\u308c\u3066\u3044\u308b<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306fpong<\/p>\n<h2>access.log,access.format<\/h2>\n<p>\u30a2\u30af\u30bb\u30b9\u30ed\u30b0\u3068\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u8a2d\u5b9a\u3059\u308b<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u30a2\u30af\u30bb\u30b9\u30ed\u30b0\u306f\u51fa\u529b\u3057\u306a\u3044<br \/>\n\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306f&#8221;%R &#8211; %u %t \\&#8221;%m %r\\&#8221; %s&#8221;<\/p>\n<h2>slowlog,request_slowlog_timeout<\/h2>\n<p>\u30b9\u30ed\u30fc\u30ed\u30b0\u3068\u305d\u306e\u79d2\u6570\u3092\u6307\u5b9a\u3059\u308b<br \/>\nrequest_slowlog_timeout\u30920s\u3068\u3059\u308b\u3068\u3001\u7121\u52b9\u3068\u306a\u308b<\/p>\n<h2>request_terminate_timeout<\/h2>\n<p>\u3072\u3068\u3064\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3059\u308b\u6700\u5927\u306e\u6642\u9593\u3002\u3053\u308c\u3092\u8d85\u3048\u308b\u3068\u3001kill\u3059\u308b<br \/>\nphp.ini\u306b\u3066max_execution_time\u3067\u5236\u5fa1\u3067\u304d\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u3068\u304d\u306b\u5229\u7528\u3059\u308b\u3079\u3057<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f0\u3067\u7121\u52b9<\/p>\n<h2>rlimit_files<\/h2>\n<p>master\u30d7\u30ed\u30bb\u30b9\u306e\u30aa\u30fc\u30d7\u30f3\u3067\u304d\u308b\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u6570\u3092\u6307\u5b9a\u3059\u308b<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u30b7\u30b9\u30c6\u30e0\u306e\u898f\u5b9a\u5024<\/p>\n<h2>rlimit_core<\/h2>\n<p>\u30b3\u30a2\u30b5\u30a4\u30ba\u306e\u5236\u9650\u3092\u6307\u5b9a\u3059\u308b<br \/>\n\u6307\u5b9a\u3067\u304d\u308b\u306e\u306f\u3001unlimited\u3001\u3082\u3057\u304f\u306f0\u4ee5\u4e0a\u306e\u6574\u6570<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u30b7\u30b9\u30c6\u30e0\u306e\u898f\u5b9a\u5024<\/p>\n<h2>chroot<\/h2>\n<p>\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306echroot\u958b\u59cb\u4f4d\u7f6e\u3092\u6c7a\u3081\u308b\u3002\u7d76\u5bfe\u30d1\u30b9\u3067\u6307\u5b9a\u3059\u308b<\/p>\n<h2>chdir<\/h2>\n<p>\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306echdir\u958b\u59cb\u4f4d\u7f6e\u3092\u6c7a\u3081\u308b\u3002\u7d76\u5bfe\u30d1\u30b9\u3067\u6307\u5b9a\u3059\u308b<\/p>\n<h2>catch_workers_output<\/h2>\n<p>\u30ef\u30fc\u30ab\u30fc\u306e\u6a19\u6e96\u51fa\u529b\u304a\u3088\u3073\u6a19\u6e96\u30a8\u30e9\u30fc\u51fa\u529b\u3092\u30a8\u30e9\u30fc\u30ed\u30b0\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u304b\u3069\u3046\u304b<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u51fa\u529b\u3057\u306a\u3044<\/p>\n<h2>security.limit_extensions<\/h2>\n<p>FPM\u304c\u30d1\u30fc\u30b9\u3059\u308b\u62e1\u5f35\u5b50\u3092\u5236\u9650\u3059\u308b<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f.php<\/p>\n<p>bugfix<\/p>\n<p>http:\/\/ankyo.blog.so-net.ne.jp\/2012-02-12<\/p>\n<p>http:\/\/tech.aainc.co.jp\/archives\/3022<\/p>\n<h1>nginx\u3068\u306e\u9023\u643a<\/h1>\n<h1>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h1>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@akat:\/home\/akat# aptitude install nginx\r\n\u4ee5\u4e0b\u306e\u65b0\u898f\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059:\r\n  nginx nginx-common{a} nginx-full{a}\r\n\u66f4\u65b0: 0 \u500b\u3001\u65b0\u898f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb: 3 \u500b\u3001\u524a\u9664: 0 \u500b\u3001\u4fdd\u7559: 1 \u500b\u3002\r\n\u30a2\u30fc\u30ab\u30a4\u30d6 570 k \u30d0\u30a4\u30c8\u4e2d 0  \u30d0\u30a4\u30c8\u3092\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u5c55\u958b\u5f8c\u306b 1,234 k \u30d0\u30a4\u30c8\u306e\u30c7\u30a3\u30b9\u30af\u9818\u57df\u304c\u65b0\u305f\u306b\u6d88\u8cbb\u3055\u308c\u307e\u3059\u3002\r\n\u5148\u306b\u9032\u307f\u307e\u3059\u304b? &#x5B;Y\/n\/?] y\r\n\u4ee5\u524d\u306b\u672a\u9078\u629e\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 nginx-common \u3092\u9078\u629e\u3057\u3066\u3044\u307e\u3059\u3002\r\n(\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059 ... \u73fe\u5728 62345 \u500b\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u307e\u3059\u3002)\r\n(...\/nginx-common_1.2.1-2.2+wheezy2_all.deb \u304b\u3089) nginx-common \u3092\u5c55\u958b\u3057\u3066\u3044\u307e\u3059...\r\n\u4ee5\u524d\u306b\u672a\u9078\u629e\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 nginx-full \u3092\u9078\u629e\u3057\u3066\u3044\u307e\u3059\u3002\r\n(...\/nginx-full_1.2.1-2.2+wheezy2_amd64.deb \u304b\u3089) nginx-full \u3092\u5c55\u958b\u3057\u3066\u3044\u307e\u3059...\r\n\u4ee5\u524d\u306b\u672a\u9078\u629e\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 nginx \u3092\u9078\u629e\u3057\u3066\u3044\u307e\u3059\u3002\r\n(...\/nginx_1.2.1-2.2+wheezy2_all.deb \u304b\u3089) nginx \u3092\u5c55\u958b\u3057\u3066\u3044\u307e\u3059...\r\nman-db \u306e\u30c8\u30ea\u30ac\u3092\u51e6\u7406\u3057\u3066\u3044\u307e\u3059 ...\r\nnginx-common (1.2.1-2.2+wheezy2) \u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059 ...\r\nnginx-full (1.2.1-2.2+wheezy2) \u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059 ...\r\nnginx (1.2.1-2.2+wheezy2) \u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059 ...\r\n<\/pre>\n<h2>\u8a2d\u5b9a-php-fpm<\/h2>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@akat:\/home\/akat# vi \/etc\/php5\/fpm\/pool.d\/www.conf\r\n===\r\nlisten = 127.0.0.1:9000 # \u8ffd\u52a0\u3059\u308b\r\n===\r\n<\/pre>\n<h2>\u8a2d\u5b9a-nginx<\/h2>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@akat:\/home\/akat# vi \/etc\/nginx\/sites-enabled\/default\r\n=======\r\nserver {\r\n        root \/var\/www\/htdocs;\r\n        index index.html index.htm;\r\n\r\n        server_name tech.akat.info;\r\n\r\n        location \/ {\r\n                try_files $uri $uri\/ \/index.html;\r\n        }\r\n\r\n        location \/doc\/ {\r\n                alias \/usr\/share\/doc\/;\r\n                autoindex on;\r\n                allow 127.0.0.1;\r\n                allow ::1;\r\n                deny all;\r\n        }\r\n\r\n        location \/nginx_status {\r\n            stub_status on;\r\n            access_log off;\r\n            allow 127.0.0.1;\r\n            deny all;\r\n        }\r\n\r\n        location ~ \\.php$ {\r\n                fastcgi_pass 127.0.0.1:9000; # FastCGI\u30b5\u30fc\u30d0\u3092\u6307\u5b9a\u3001upstream\u30d6\u30ed\u30c3\u30af\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\r\n                include fastcgi_params;\r\n        }\r\n}\r\n=======\r\nroot@akat:\/home\/akat# nginx -t\r\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\r\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful\r\nroot@www27032ue:\/etc\/nginx\/sites-enabled# \/etc\/init.d\/nginx restart\r\nRestarting nginx: nginx.\r\n<\/pre>\n<p>nginx_status\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3068\u304d<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@akat:\/etc\/nginx# curl http:\/\/localhost\/nginx_status\r\nActive connections: 1\r\nserver accepts handled requests\r\n 4 4 7\r\nReading: 0 Writing: 1 Waiting: 0\r\n<\/pre>\n<h2>\u304a\u307e\u3051<\/h2>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n        default_type &quot;text\/html; charset=utf-8&quot;;\r\n        echo &quot;$variable&quot;;\r\n<\/pre>\n<p>\u3092\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8f09\u3059\u308b\u3053\u3068\u3067\u3001\u5909\u6570\u3092\u78ba\u8a8d\u53ef\u80fd<\/p>\n<h2>\u78ba\u8a8d\u4e8b\u9805<\/h2>\n<p>port\u3088\u308a\u3082unix socket\u304c\u65e9\u3044\uff1f<br \/>\nhttp:\/\/dogmap.jp\/2013\/04\/16\/sakura-vps-performance-tuning\/<br \/>\nhttp:\/\/blog.scratchpad.jp\/nginx-optimize\/<br \/>\nhttp:\/\/blog.kubox.info\/2011\/07\/nginxphp-fpm.html<\/p>\n<h2>\u53c2\u8003<\/h2>\n<p>http:\/\/www.php.net\/manual\/ja\/install.fpm.php<br \/>\nhttp:\/\/php.net\/manual\/ja\/install.fpm.configuration.php<br \/>\nhttp:\/\/server-setting.info\/centos\/apache-nginx-9-sakura-vps.html<br \/>\nhttp:\/\/server-setting.info\/debian\/apache-mod_fastcgi-php-fpm-debian.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>php-fpm fpm(FastCGI Process Manager)\u306f\u3001php-cgi\u306e\u30d7\u30ed\u30bb\u30b9\u7ba1\u7406\u304c\u3067\u304d\u308b PHP5.4.0\u304b\u3089\u516c\u5f0f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\u30ed\u30f3\u30b0\u30b5\u30dd\u30fc\u30c8\u304c\u671f\u5f85\u3067\u304d\u308b \u3067\u304d\u308b\u3053\u3068 \u30fb\u7de9\u3084\u304b\u306a (grac [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[18,9],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/299"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=299"}],"version-history":[{"count":23,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/299\/revisions"}],"predecessor-version":[{"id":1420,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/299\/revisions\/1420"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}