移动网络化生活,关注智能手机、网络、cms
yum安装带mpm-itk的apache
上一篇关于mpm-itk的文章是我自己编译的文件,后来才发现在网上有一个源编译的就是apache2 with mpm-itk,这样就更省事了,这个源的更新还能跟的上apache2的版本,在这里分布一下。
1、首先要创建repo文件
第一步的说明,都可以在http://centos.alt.ru/repository/centos/readme.txt中找到。
下面以centos6为例
[CentALT] name=CentALT Packages for Enterprise Linux 6 - $basearch baseurl=http://centos.alt.ru/repository/centos/6/$basearch/ enabled=1 gpgcheck=0
最好将enabled=1改成0,因为该源中还有一些其它软件,在update时会有冲突。
或者
for i386 rpm -ihv http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm for x86_64 rpm -ihv http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
同样更改enabled=0。
2、安装httpd apache2
在服务器中还没有安装httpd时
yum --enablerepo=CentALT install httpd
升级用
yum --enablerepo=CentALT update httpd
3、部分设置
安装后,并不是以mpm-itk方式运行的,这时需要进行一些设置,将/etc/sysconfig/httpd 文件中的
; HTTPD=/usr/sbin/httpd.itk
去掉注释
在/etc/httpd/conf.d/里创建itk.conf文件,内容为下:
## ## Server-Pool Size Regulation (MPM specific) ## <IfModule itk.c> LoadModule php5_module modules/libphp5.so </IfModule> <IfModule itk.c> <IfModule sapi_apache2.c> php_value session.save_path /tmp </IfModule> </IfModule> # itk MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # ServerLimit: maximum value for MaxClients for the lifetime of the server # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule itk.c> StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4000 </IfModule>
现在将可以启动或重新启动httpd
service restart httpd
在<VirtualHost></VirtualHost>里添加:
</pre> <IfModule itk.c> AssignUserId someuser someuser </IfModule> <pre>
如有不当之外,请指教。
您好,我想请教一下。为apache指定的用户是否需要设置密码?如果设置了密码如何告诉apache?