{"id":5055,"date":"2016-10-18T15:47:40","date_gmt":"2016-10-18T12:47:40","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=5055"},"modified":"2016-10-18T15:47:40","modified_gmt":"2016-10-18T12:47:40","slug":"apache-fastcgi-php-fpm","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=5055","title":{"rendered":"[apache] fastcgi + php-fpm"},"content":{"rendered":"<p><strong><span style=\"color: #ff0000;\">1) \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/span><\/strong><\/p>\n<p><code># apt-get install libapache2-mod-fastcgi\u00a0php5-fpm<\/code><\/p>\n<p><span style=\"color: #ff0000;\"><strong>2) \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 php.<\/strong><\/span><\/p>\n<p>\u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 <strong>php-fpm.conf<\/strong> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u043a\u0435\u0442:<\/p>\n<p><code>listen = 127.0.0.1:9000<\/code><\/p>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043c <strong>php<\/strong>.<!--more--><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u00a0<strong>030_php-fpm.conf<\/strong> \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0438 \u043b\u043e\u0436\u0438\u043c \u0435\u0433\u043e \u0432\u00a0<strong>\/etc\/apache2\/mods-enabled<\/strong>:<\/p>\n<pre>&lt;IfModule proxy_fcgi_module&gt;\r\n \u00a0\u00a0\u00a0&lt;IfModule dir_module&gt;\r\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0DirectoryIndex index.php\r\n \u00a0\u00a0\u00a0&lt;\/IfModule&gt;\r\n \u00a0\u00a0\u00a0&lt;FilesMatch \"\\.php$\"&gt;\r\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0SetHandler \"proxy:fcgi:\/\/127.0.0.1:9000\"\r\n \u00a0\u00a0\u00a0&lt;\/FilesMatch&gt;\r\n \u00a0\u00a0\u00a0ProxyTimeout 1200\r\n&lt;\/IfModule&gt;\r\n<\/pre>\n<p><strong><span style=\"color: #ff0000;\">3) \u0420\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b apache.<\/span><\/strong><\/p>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0440\u0435\u0436\u0438\u043c\u00a0mpm_event, \u0447\u0442\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u043d\u043e\u0433\u043e\u0442\u0440\u0435\u0434\u043e\u0432\u044b\u043c.<\/p>\n<p><code># a2enmod mpm_event<\/code><\/p>\n<p>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b <strong>fastcgi<\/strong>:<\/p>\n<p><code># a2enmod proxy<br \/>\n# a2enmod proxy_http<\/code><\/p>\n<p>\u0412\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c <strong>mpm_prefork<\/strong> (\u043e\u043d \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u0435\u0442 \u0441 <strong>mpm_event<\/strong>) \u0438 <strong>php5<\/strong> (<strong>mod_php<\/strong>)<\/p>\n<p><code># a2dismod mpm_prefork<br \/>\n# a2dismod php5<\/code><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443:<\/p>\n<p><code># apache2ctl restart<br \/>\n# apache2ctl -V<br \/>\nServer version: Apache\/2.4.23 (Ubuntu)<br \/>\nServer built: 2016-07-11T00:00:00<br \/>\nServer's Module Magic Number: 20120211:61<br \/>\nServer loaded: APR 1.5.1-dev, APR-UTIL 1.5.3<br \/>\nCompiled using: APR 1.5.2, APR-UTIL 1.5.4<br \/>\nArchitecture: 64-bit<br \/>\n<span style=\"color: #ff0000;\">Server MPM: event<\/span><br \/>\n<span style=\"color: #ff0000;\"> threaded: yes (fixed thread count)<\/span><br \/>\n<span style=\"color: #ff0000;\"> forked: yes (variable process count)<\/span><br \/>\nServer compiled with....<br \/>\n-D APR_HAS_SENDFILE<br \/>\n-D APR_HAS_MMAP<br \/>\n-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)<br \/>\n-D APR_USE_SYSVSEM_SERIALIZE<br \/>\n-D APR_USE_PTHREAD_SERIALIZE<br \/>\n-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT<br \/>\n-D APR_HAS_OTHER_CHILD<br \/>\n-D AP_HAVE_RELIABLE_PIPED_LOGS<br \/>\n-D DYNAMIC_MODULE_LIMIT=256<br \/>\n-D HTTPD_ROOT=\"\/etc\/apache2\"<br \/>\n-D SUEXEC_BIN=\"\/usr\/lib\/apache2\/suexec\"<br \/>\n-D DEFAULT_PIDLOG=\"\/var\/run\/apache2.pid\"<br \/>\n-D DEFAULT_SCOREBOARD=\"logs\/apache_runtime_status\"<br \/>\n-D DEFAULT_ERRORLOG=\"logs\/error_log\"<br \/>\n-D AP_TYPES_CONFIG_FILE=\"mime.types\"<br \/>\n-D SERVER_CONFIG_FILE=\"apache2.conf\"<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1) \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 # apt-get install libapache2-mod-fastcgi\u00a0php5-fpm 2) \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 php. \u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 php-fpm.conf \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u043a\u0435\u0442: listen = 127.0.0.1:9000 \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043c php.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,15],"tags":[],"class_list":["post-5055","post","type-post","status-publish","format-standard","hentry","category-others","category-www"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5055"}],"version-history":[{"count":1,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5055\/revisions"}],"predecessor-version":[{"id":5056,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5055\/revisions\/5056"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}