Chinaunix首页 | 论坛 | 博客
  • 博客访问: 516017
  • 博文数量: 184
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 2490
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-09 11:34
文章分类

全部博文(184)

文章存档

2011年(1)

2010年(2)

2009年(12)

2008年(169)

我的朋友

分类: LINUX

2008-11-23 15:51:14

suPHP is a tool for executing PHP scripts with the permissions of their owners. It consists of an Apache module (mod_suphp) and a setuid root binary (suphp) that is called by the Apache module to change the uid of the process executing the PHP interpreter.

[url][/url]

下载后即可安装,过程十分简单:

tar zxf suphp-0.5.2.tar.gz
cd suphp-0.5.2
./configure \\
–with-php=/usr/local/bin/php \\
–with-apxs=/usr/local/apache2/bin/apxs \\
–with-logfile=/var/log/suphp \\
–with-apache-user=www
gmake
gmake install

即可完成安装。

mod_suPHPsh实际上是以cgi的方式运行php脚本。对于不需要以其他用户身份运行的脚本仍然可以使用mod_php4来处理。两种方式的切换简而言之就是
php_admin_flag engine on/off
suPHP_Engine on/off
的配置(在VirtualHost或者Main Server的Configuration中)

参考网址:
[url][/url]
[url][/url]

另注:编译时的–with-php中指定的php必须是CGI方式的可执行文件,而不能是cli的,否则运行时会因为没有正确的http头而导致cgi500错误。要编译cgi的可执行文件,需要在编译php时的configure中不设置–with-apxs2才行,否则即使使用了–enable-cgi,编译程序仍然不会编译安装cgi方式的php可执行程序(php-4.3.10中是这样)。

阅读(509) | 评论(0) | 转发(0) |
0

上一篇:配置suPHP

下一篇:隱藏 Apache 及 PHP 版本

给主人留下些什么吧!~~