server.document-root = "/var/www" 

server.port = 80

#server.username = "root" 
#server.groupname = "root" 


## modules to load
# at least mod_access and mod_accesslog should be loaded
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory
server.modules              = (
                               "mod_rewrite",
                               "mod_redirect",
#                               "mod_alias",
                                "mod_access",
#                               "mod_cml",
#                               "mod_trigger_b4_dl",
#                               "mod_auth",
#                               "mod_status",
#                               "mod_setenv",
                               "mod_fastcgi",
#                               "mod_proxy",
#                               "mod_simple_vhost",
#                               "mod_evhost",
#                               "mod_userdir",
                               "mod_cgi",
#                               "mod_compress",
#                               "mod_ssi",
#                               "mod_usertrack",
#                               "mod_expire",
                               "mod_secdownload",
#                               "mod_rrdtool",
                                "mod_accesslog" )


mimetype.assign = (
  ".html" => "text/html", 
  ".txt" => "text/plain",
  ".jpg" => "image/jpeg",
  ".png" => "image/png",
  ".css" => "text/css"
)

#### CGI module
cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
                               ".cgi" => "/usr/bin/perl",
                                "/admin" => "",
								"/admindb" => "",
								"/confirm" => "",
								"/create" => "",
								"/edithtml" => "",
								"/listinfo" => "",
								"/options" => "",
								"/private" => "",
								"/rmlist" => "",
								"/roster" => "",
								"/subscribe" => "" )




#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
#fastcgi.server             = ( ".php" =>
#                               ( "localhost" =>
#                                 (
#                                   "socket" => "/tmp/php-fastcgi.socket",
#                                   "bin-path" => "/usr/bin/php"
#                                 )
#                               )
#                            )

#### url handling modules (rewrite, redirect, access)
#url.rewrite                = ( "^/$"             => "/server-status" )
#url.redirect               = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
#### both rewrite/redirect support back reference to regex conditional using %n
#$HTTP["host"] =~ "^www\.(.*)" {
#  url.redirect            = ( "^/(.*)" => "http://%1/$1" )
#}

static-file.exclude-extensions = ( ".cgi", ".fcgi", ".php", ".rb", "~", ".inc" )
index-file.names = ( "index.html", "index.php" )

$HTTP["host"] == "www2.example.org" {
  server.document-root = "/var/www/" 
  $HTTP["url"] =~ "^/download/" {
    dir-listing.activate = "enable" 
  }
}

#### accesslog module
accesslog.filename          = "/var/log/access_lighttpd.log"


############# experimentos ##################
#url.rewrite = ( "^/([a-z]+)/([a-z]+)(\?*)(.*)" => "/index.html?url=$2&$4" )
url.rewrite = ("(css|files|img|js)/(.*)" => "/$1/$2")

fastcgi.server = ( ".php" => ((                                      
                     "bin-path" => "/usr/bin/php-cgi",             
                     "socket" => "/tmp/php.socket",              
                     "max-procs" => 1,                                     
                     "bin-environment" => (                         
                       "PHP_FCGI_CHILDREN" => "16",                    
                       "PHP_FCGI_MAX_REQUESTS" => "10000"           
                     ),         
                     "broken-scriptfilename" => "enable"
#                  )), 
#    "/cgi-bin/" =>
#    ((
#        "socket" => "/tmp/php.socket1",
#       "bin-path" => "/var/www/test.cgi",
#        "check-local" => "disable",
#        "max-procs" => 1
    )))
                 
                 
#### compress module
#compress.cache-dir       = "/tmp/lighttpd_tmp/"
#compress.filetype        = ("text/plain", "text/html", "text/css", "image/png")

## where to upload files to, purged daily.
server.upload-dirs = ( "/tmp" )

server.pid-file = "/var/run/lighttpd.pid"

