Lighttpd with CGI

This is a quick and dirty guide to run Lighttpd with CGI on your machine.

After installing, modify /etc/lighttpd/lighttpd.conf:

Add "mod_cgi" to this section to load cgi module:

server.modules              = (
            "mod_access",
            "mod_alias",
# more modules
 )

Assign CGI files:

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", "py", "cgi" )
cgi.assign = (	".pl" => "/usr/bin/perl",
		".py" => "/usr/bin/python",
		".cgi" => "",
		".fcgi" => ""
		)

I guess the code below will turn your server to a private one:

$HTTP["remoteip"]  !~ "127.0.0.1" { url.access-deny = ("") }

Now just restart Lighttpd and enjoy!

Leave a Reply