TracNav menu
-
Core Features
- Configuration File Syntax
- Configuration Options
- Change Root
- Performance
- PerformanceFastCGI
- SSL
- Traffic Shaping
- Using SMP
-
Modules
- mod_accesslog
- mod_access
- mod_alias
- mod_auth
- mod_cache
- mod_cgi
- mod_cml
- mod_compress
- mod_deflate
- mod_dirlisting
- mod_evasive
- mod_evhost
- mod_expire
- mod_extforward
- mod_fastcgi
- mod_flv_streaming
- mod_geoip
- mod_magnet
- mod_mem_cache
- mod_mysql_vhost
- mod_proxy
- mod_redirect
- mod_rewrite
- mod_rrdtool
- mod_scgi
- mod_secdownload
- mod_setenv
- mod_simple_vhost
- mod_ssi
- mod_status
- mod_trigger_b4_dl
- mod_userdir
- mod_useronline
- mod_usertrack
- mod_webdav
-
Modules (1.5 only)
- mod_proxy_core
- mod_sql_vhost_core
- mod_uploadprogress
- mod_deflate
-
Internals
- FastCGI state-engine
- Plugin interface
- HTTP state-engine
-
Additional
- User written Modules
CGI
Module: mod_cgi
Description
CGI programs allow you to enhance the functionality of the server in a very straight-forward and simple way.
Options
cgi.assign
file-extensions that are handled by a CGI program
e.g.:
cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini.
To get the old cgi-bin behavior of apache:
#Note: make sure that mod_alias is loaded if you use this: alias.url += ( "/cgi-bin" => server_root + "/cgi-bin" ) $HTTP["url"] =~ "^/cgi-bin" { cgi.assign = ( "" => "" ) }
cgi.execute-all
In 1.5.0 and later you can use:
$PHYSICAL["existing-path"] =~ "^/var/www/myvhost/cgi-bin/" { cgi.execute-all = "enable" }which does the same thing as cgi.assign = ("" => "") but is more obvious to use.
Examples
To setup an executable which can run on its own (e.g. binaries, scripts with a shebang line) you just don't specify a handler for the extension:
cgi.assign = ( ".sh" => "" )
If the file has no extension keep in mind that lighttpd matches not the extension itself but the right part of the URL:
cgi.assign = ( "/testfile" => "" )

