Joe Gillotti | 19 Dec 2011 06:34
Favicon
Gravatar

Howto for suphp+lighttpd+FreeBSD

Hello,

To get suPHP working with Lighttpd on FreeBSD, you'd use an extra config 
file such as the following:

server.modules += ( "mod_setenv" ) # Load Env
server.modules += ( "mod_cgi" ) # Load CGI
$HTTP["url"] =~ ".php|\/$" { # match .php files
setenv.add-environment = (
"SUPHP_HANDLER" => "application/x-httpd-php"
)
}
$HTTP["url"] =~ ".pl|.py|.cgi$" { # Also handle normal CGI scripts
setenv.add-environment = (
"SUPHP_HANDLER" => "x-suphp-cgi"
)
}
cgi.assign = ( # Actually use suphp
".pl" => "/usr/local/sbin/suphp",
".py" => "/usr/local/sbin/suphp",
".cgi" => "/usr/local/sbin/suphp",
".php" => "/usr/local/sbin/suphp"
)

For use with Debian and other operating systems, one need only change 
the path to the suphp binary. A further explanation is here: 
http://blog.joegillotti.com/2011/08/19/usually-ignored-features-of-suphp/

I assume some people may find this useful for privilege separation under 
non-Apache webservers.
(Continue reading)


Gmane