从prefork MPM切换到工人MPM + PHP-FPM在Ubuntu [英] Switching from prefork MPM to worker MPM + php-fpm on ubuntu

查看:251
本文介绍了从prefork MPM切换到工人MPM + PHP-FPM在Ubuntu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有教程,我发现是如何重新安装工人MPM + PHP-FPM,因为我的话preSS的博客已经启动和prefork MPM运行,纠正我,如果我错了,在模拟安装过程

我在Ubuntu和根据一些教程,下面的行会做所有的招数:

 的apt-get安装的apache2-MPM-工人中的libapache2-MOD-的FastCGI PHP5-FPM PHP5-GD
a2enmod行动FastCGI的别名

然后你在安装配置 /etc/apache2/conf.d/php5-fpm.conf

 < IfModule mod_fastcgi.c>
                AddHandler的PHP5-FCGI的.php
                操作PHP5-FCGI / PHP5-FCGI
                别名/ PHP5-FCGI / usr / lib目录/ cgi-bin目录/ PHP5-FCGI
                FastCgiExternalServer / usr / lib目录/ cgi-bin目录/ PHP5-FCGI -host 127.0.0.1:9000 -pass头授权
< / IfModule>

在所有这些,重新启动:

 服务的Apache2重启和放大器;&安培;服务PHP5-FPM重启

问:

1)会造成任何停机时间为previously运行带有prefork MPM网站的整个过程?

2)你有改变,如PHP或MySQL或Apache2的(他们将采取没有你做任何事情的开关后立即生效)?任何已经存在的配置文件

3)我已经APC运行起来,你必须重新安装/开关后重新配置?

4)如何您查出的Apache2在工人MPM模式下工作正常?

非常感谢!


解决方案

  1. 是的,它必须至少更换httpd进程的运行。你一定要测试这对发展建立第一。它很容易在一个配置文件需要一段时间来找出错误的。


  2. 要PHP,MySQL的没有变化。是摆在工人的配置更改Apache的httpd.conf - 他们是从prefork设置很大的不同。你需要做这些改变自己在httpd.conf。


  3. 没有,因为这是一个PHP模块,每当PHP运行它的作品。这么说,这将运行在php-fpm的每个池一个副本,因此,如果您有多个域,你可以将它们组合成一个池来共享......但如果​​你做到这一点需要注意的安全问题。


  4. 的httpd -V显示服务器MPM


好运!

All tutorials I found were how to fresh install worker MPM + PHP-FPM, since my wordpress blog's already up and running with prefork MPM, correct me if I'm wrong in the simulated installation process:

I'm on ubuntu and according to some tutorials, the following lines would do all the tricks:

apt-get install apache2-mpm-worker libapache2-mod-fastcgi php5-fpm php5-gd
a2enmod actions fastcgi alias

Then you setup configuration in /etc/apache2/conf.d/php5-fpm.conf:

<IfModule mod_fastcgi.c>
                AddHandler php5-fcgi .php
                Action php5-fcgi /php5-fcgi
                Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
                FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
</IfModule>

After all these, restart:

service apache2 restart && service php5-fpm restart

Question:

1) Would it cause any down time in the whole process for previously running sites with prefork MPM?

2) Do you have to change any already existent configuration files like php or mysql or apache2(would they take effect immediately after the switch without you doing anything)?

3) I've already have apc up and running, do you have to re-install/re-configure it after the switch?

4) How do you find out if apache2 is working in worker MPM mode as expected?

Thanks a lot!

解决方案

  1. yes, it has to at least replace the httpd process running. you definitely want to test this on a development set up first. it's easy to have a mistake in a config file that takes a while to figure out.

  2. no changes to php, mysql. yes changes to apache httpd.conf to put in worker configurations - they are very different from prefork settings. you need to do these changes yourself in httpd.conf.

  3. no, since this is a php module, whenever php runs it works. that said, it will run one copy for each pool in php-fpm, so if you have multiple domains, you could group them into a pool to share...but be aware of security concerns if you do that.

  4. httpd -V shows "server mpm"

good luck!

这篇关于从prefork MPM切换到工人MPM + PHP-FPM在Ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆