分类: LINUX
2008-11-23 15:50:20
1.安装httpd的开发包,httpd-devel
2.安装编译suPHP
#./configure –prefix=/usr –with-apxs2=/usr/sbin/apxs -
-sysconfdir=/etc/httpd/conf –with-apache-user=apache –with-setid-mode=owner
–with-apache-user=apache是设置apache的运行用户
–with-setid-mode=owner设置suPHP的模式,有force,paranoid,owner
3.修改httpd.conf
加入:LoadModule suphp_module modules/mod_suphp.so
suPHP_Engine on #开启/关闭suPHP
suPHP_ConfigPath /etc/httpd/conf #配置文件目录
suPHP_AddHandler x-httpd-php
AddHandler x-httpd-php .php
4.添加suphp.conf
在/etc/httpd/conf里面添加suphp.conf文件
[global]
;Path to logfile
logfile=/var/log/suphp.log
;Loglevel
loglevel=info
;User Apache is running as
webserver_user=apache
;Path all scripts have to be in
docroot=/
;Path to chroot() to before executing script
;chroot=/mychroot
; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=true
;Send minor error messages to browser
errors_to_browser=false
;PATH environment variable
env_path=/bin:/usr/bin
;Umask to set, specify in octal notation
umask=0007
; Minimum UID
min_uid=48
; Minimum GID
min_gid=48
[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php
;Handler for CGI-scripts
x-suphp-cgi=execute:!self