1、 yum安装环境
apache php 都是用Yum安装
# yum install httpd php php-cli
保证php有php-cgi,因为suphp需要php的执行模式为cgi/fastcgi
[www.inhai.com:/root]#php -v
PHP 5.2.6 (cli) (built: May 5 2008 10:32:59)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
[www.inhai.com:/root]#php-cgi -v
PHP 5.2.6 (cgi-fcgi) (built: May 5 2008 10:29:53)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
Suphp安装
# wget http://www.suphp.org/download/suphp-0.7.1.tar.gz
# tar zvxf suphp-0.7.1.tar.gz
# cd suphp-0.7.1
Suphp的编译参数有2种 主要是setid-mode的区别
1、测试模式,没有任何安全所言
# ./configure --prefix=/usr/local/suphp \
--sysconfdir=/usr/local/suphp/etc \
--with-apache-user=apache \
--with-setid-mode=owner \
--with-apxs=/usr/sbin/apxs \
--with-apr=/usr/bin/apr-1-config
2、生产模式使用下面的配置
# ./configure --prefix=/usr/local/suphp \
--sysconfdir=/usr/local/suphp/etc \
--with-apache-user=apache \
--with-setid-mode=paranoid \
--with-apxs=/usr/sbin/apxs \
--with-apr=/usr/bin/apr-1-config
具体2者的区别 将在后面apache配置那里说明
# make
# make install
# mkdir /usr/local/suphp/etc
# cp doc/suphp.conf-example /usr/local/suphp/etc/suphp.conf
如果装不上,提示缺少apr、apr-util、apxs等文件,可以执行
yum -y in