Annotation of embedaddon/lighttpd/tests/lighttpd.conf, revision 1.1.1.2

1.1       misho       1: debug.log-request-handling = "enable"
                      2: debug.log-request-header = "enable"
                      3: debug.log-response-header = "enable"
1.1.1.2 ! misho       4: #debug.log-condition-handling = "enable"
1.1       misho       5: server.document-root         = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
                      6: 
                      7: ## 64 Mbyte ... nice limit
                      8: server.max-request-size = 65000
                      9: 
                     10: ## bind to port (default: 80)
                     11: server.port                 = 2048
                     12: 
                     13: ## bind to localhost (default: all interfaces)
                     14: server.bind                = "localhost"
                     15: server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
                     16: server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
                     17: server.name                = "www.example.org"
                     18: server.tag                 = "Apache 1.3.29"
                     19: 
                     20: server.dir-listing          = "enable"
                     21: 
1.1.1.2 ! misho      22: server.modules = (
        !            23:        "mod_rewrite",
        !            24:        "mod_setenv",
        !            25:        "mod_secdownload",
        !            26:        "mod_access",
        !            27:        "mod_auth",
        !            28:        "mod_status",
        !            29:        "mod_expire",
        !            30:        "mod_simple_vhost",
        !            31:        "mod_redirect",
        !            32:        "mod_fastcgi",
        !            33:        "mod_cgi",
        !            34:        "mod_compress",
        !            35:        "mod_userdir",
        !            36:        "mod_ssi",
        !            37:        "mod_accesslog",
        !            38: )
        !            39: 
        !            40: server.indexfiles = (
        !            41:        "index.php",
        !            42:        "index.html",
        !            43:        "index.htm",
        !            44:        "default.htm",
        !            45: )
1.1       misho      46: 
                     47: ######################## MODULE CONFIG ############################
                     48: 
1.1.1.2 ! misho      49: ssi.extension = (
        !            50:        ".shtml",
        !            51: )
        !            52: 
        !            53: accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
        !            54: 
        !            55: mimetype.assign = (
        !            56:        ".png"  => "image/png",
        !            57:        ".jpg"  => "image/jpeg",
        !            58:        ".jpeg" => "image/jpeg",
        !            59:        ".gif"  => "image/gif",
        !            60:        ".html" => "text/html",
        !            61:        ".htm"  => "text/html",
        !            62:        ".pdf"  => "application/pdf",
        !            63:        ".swf"  => "application/x-shockwave-flash",
        !            64:        ".spl"  => "application/futuresplash",
        !            65:        ".txt"  => "text/plain",
        !            66:        ".tar.gz" =>   "application/x-tgz",
        !            67:        ".tgz"  => "application/x-tgz",
        !            68:        ".gz"   => "application/x-gzip",
        !            69:        ".c"    => "text/plain",
        !            70:        ".conf" => "text/plain",
        !            71: )
1.1       misho      72: 
                     73: $HTTP["host"] == "cache.example.org" {
1.1.1.2 ! misho      74:        compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
1.1       misho      75: }
1.1.1.2 ! misho      76: compress.filetype = (
        !            77:        "text/plain",
        !            78:        "text/html",
        !            79: )
        !            80: 
        !            81: setenv.add-environment = (
        !            82:        "TRAC_ENV" => "tracenv",
        !            83:        "SETENV" => "setenv",
        !            84: )
        !            85: setenv.add-request-header = (
        !            86:        "FOO" => "foo",
        !            87: )
        !            88: setenv.add-response-header = (
        !            89:        "BAR" => "foo",
        !            90: )
1.1       misho      91: 
                     92: $HTTP["url"] =~ "\.pdf$" {
1.1.1.2 ! misho      93:        server.range-requests = "disable"
1.1       misho      94: }
                     95: 
1.1.1.2 ! misho      96: fastcgi.debug = 0
        !            97: fastcgi.server = (
        !            98:        ".php" => ( (
        !            99:                "host" => "127.0.0.1",
        !           100:                "port" => 1026,
        !           101:                "broken-scriptfilename" => "enable",
        !           102:                "allow-x-send-file" => "enable",
        !           103:        ) ),
        !           104:        "/prefix.fcgi" => ( (
        !           105:                "host" => "127.0.0.1",
        !           106:                "port" => 1026,
        !           107:                "check-local" => "disable",
        !           108:                "broken-scriptfilename" => "enable",
        !           109:        ) ),
        !           110: )
        !           111: 
        !           112: cgi.assign = (
        !           113:        ".pl"  => env.PERL,
        !           114:        ".cgi" => env.PERL,
        !           115: )
        !           116: 
        !           117: userdir.include-user = (
        !           118:        "jan",
        !           119: )
1.1       misho     120: userdir.path = "/"
                    121: 
                    122: $HTTP["host"] == "auth-htpasswd.example.org" {
1.1.1.2 ! misho     123:        auth.backend = "htpasswd"
1.1       misho     124: }
                    125: 
1.1.1.2 ! misho     126: auth.backend = "plain"
1.1       misho     127: auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
                    128: 
                    129: auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
                    130: 
1.1.1.2 ! misho     131: auth.require = (
        !           132:        "/server-status" => (
        !           133:                "method"  => "digest",
        !           134:                "realm"   => "download archiv",
        !           135:                "require" => "group=www|user=jan|host=192.168.2.10",
        !           136:        ),
        !           137:        "/server-config" => (
        !           138:                "method"  => "basic",
        !           139:                "realm"   => "download archiv",
        !           140:                "require" => "valid-user",
        !           141:        ),
        !           142: )
        !           143: 
        !           144: url.access-deny = (
        !           145:        "~",
        !           146:        ".inc",
        !           147: )
        !           148: 
        !           149: url.rewrite = (
        !           150:        "^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1",
        !           151:        "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1",
        !           152: )
        !           153: 
        !           154: url.rewrite-if-not-file = (
        !           155:        "^(/rewrite/[^?]*)(?:\?(.*))?$" => "/indexfile/rewrite.php?file=$1&$2",
        !           156: )
        !           157: 
        !           158: expire.url = (
        !           159:        "/expire/access" => "access 2 hours",
        !           160:        "/expire/modification" => "access plus 1 seconds 2 minutes",
        !           161: )
1.1       misho     162: 
                    163: #### status module
1.1.1.2 ! misho     164: status.status-url = "/server-status"
        !           165: status.config-url = "/server-config"
1.1       misho     166: 
                    167: $HTTP["host"] == "vvv.example.org" {
1.1.1.2 ! misho     168:        server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
        !           169:        secdownload.secret          = "verysecret"
        !           170:        secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
        !           171:        secdownload.uri-prefix      = "/sec/"
        !           172:        secdownload.timeout         = 120
        !           173:        secdownload.algorithm       = "md5"
        !           174: }
        !           175: 
        !           176: $HTTP["host"] == "vvv-sha1.example.org" {
        !           177:        server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
        !           178:        secdownload.secret          = "verysecret"
        !           179:        secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
        !           180:        secdownload.uri-prefix      = "/sec/"
        !           181:        secdownload.timeout         = 120
        !           182:        secdownload.algorithm       = "hmac-sha1"
        !           183: }
        !           184: 
        !           185: $HTTP["host"] == "vvv-sha256.example.org" {
        !           186:        server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
        !           187:        secdownload.secret          = "verysecret"
        !           188:        secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
        !           189:        secdownload.uri-prefix      = "/sec/"
        !           190:        secdownload.timeout         = 120
        !           191:        secdownload.algorithm       = "hmac-sha256"
1.1       misho     192: }
                    193: 
                    194: $HTTP["host"] == "zzz.example.org" {
1.1.1.2 ! misho     195:        server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
        !           196:        server.name = "zzz.example.org"
        !           197:        static-file.disable-pathinfo = "enable"
1.1       misho     198: }
                    199: 
                    200: $HTTP["host"] == "symlink.example.org" {
1.1.1.2 ! misho     201:        server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
        !           202:        server.name = "symlink.example.org"
        !           203:        server.follow-symlink = "enable"
1.1       misho     204: }
                    205: 
                    206: $HTTP["host"] == "nosymlink.example.org" {
1.1.1.2 ! misho     207:        server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
        !           208:        server.name = "symlink.example.org"
        !           209:        server.follow-symlink = "disable"
1.1       misho     210: }
                    211: 
                    212: $HTTP["host"] == "no-simple.example.org" {
1.1.1.2 ! misho     213:        server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/123.example.org/pages/"
        !           214:        server.name = "zzz.example.org"
1.1       misho     215: }
                    216: 
                    217: $HTTP["host"] !~ "(no-simple\.example\.org)" {
1.1.1.2 ! misho     218:        simple-vhost.document-root  = "pages"
        !           219:        simple-vhost.server-root    = env.SRCDIR + "/tmp/lighttpd/servers/"
        !           220:        simple-vhost.default-host   = "www.example.org"
1.1       misho     221: }
                    222: 
                    223: $HTTP["host"] == "auth.example.org" {
1.1.1.2 ! misho     224:        server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
        !           225:        server.name = "auth.example.org"
        !           226:        auth.backend = "htpasswd"
        !           227:        auth.require = (
        !           228:                "" => (
        !           229:                        "method"  => "basic",
        !           230:                        "realm"   => "download archiv",
        !           231:                        "require" => "valid-user",
        !           232:                ),
        !           233:        )
1.1       misho     234: }
                    235: 
                    236: $HTTP["host"] =~ "(vvv).example.org" {
1.1.1.2 ! misho     237:        url.redirect = (
        !           238:                "^/redirect/$" => "http://localhost:2048/",
        !           239:        )
1.1       misho     240: }
                    241: 
                    242: $HTTP["host"] =~ "(zzz).example.org" {
1.1.1.2 ! misho     243:        url.redirect = (
        !           244:                "^/redirect/$" => "http://localhost:2048/%1",
        !           245:        )
1.1       misho     246: }
                    247: 
                    248: $HTTP["host"] =~ "(remoteip)\.example\.org" {
1.1.1.2 ! misho     249:        $HTTP["remoteip"] =~ "(127\.0\.0\.1)" {
        !           250:                url.redirect = (
        !           251:                        "^/redirect/$" => "http://localhost:2048/%1",
        !           252:                )
        !           253:        }
1.1       misho     254: }
                    255: 
                    256: $HTTP["remoteip"] =~ "(127\.0\.0\.1)" {
1.1.1.2 ! misho     257:        $HTTP["host"] =~ "(remoteip2)\.example\.org" {
        !           258:                url.redirect = (
        !           259:                        "^/redirect/$" => "http://localhost:2048/%1",
        !           260:                )
        !           261:        }
1.1       misho     262: }
                    263: 
                    264: $HTTP["host"] =~ "bug255\.example\.org$" {
1.1.1.2 ! misho     265:        $HTTP["remoteip"] == "127.0.0.1" {
        !           266:                url.access-deny = (
        !           267:                        "",
        !           268:                )
        !           269:        }
1.1       misho     270: }
                    271: 
                    272: $HTTP["referer"] !~ "^($|http://referer\.example\.org)" {
1.1.1.2 ! misho     273:        url.access-deny = (
        !           274:                ".jpg",
        !           275:        )
1.1       misho     276: }
                    277: 
                    278: # deny access for all image stealers
                    279: $HTTP["host"] == "referer.example.org" {
1.1.1.2 ! misho     280:        $HTTP["referer"] !~ "^($|http://referer\.example\.org)" {
        !           281:                url.access-deny = (
        !           282:                        ".png",
        !           283:                )
        !           284:        }
1.1       misho     285: }
                    286: 
                    287: $HTTP["cookie"] =~ "empty-ref" {
1.1.1.2 ! misho     288:        $HTTP["referer"] == "" {
        !           289:                url.access-deny = (
        !           290:                        "",
        !           291:                )
        !           292:        }
1.1       misho     293: }
                    294: 
1.1.1.2 ! misho     295: $HTTP["host"] =~ "allow\.example\.org$" {
        !           296:        url.access-allow = ( ".txt" ) # allow takes precedence over deny
        !           297:        url.access-deny = ( ".txt" )
        !           298: }
1.1       misho     299: 
                    300: $HTTP["host"] == "etag.example.org" {
1.1.1.2 ! misho     301:        static-file.etags = "disable"
        !           302:        compress.filetype = ()
1.1       misho     303: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>