[tests] some test config cleanup

including limiting use of php in tests to mod-fastcgi.t
personal/stbuehler/fix-fdevent
Glenn Strauss 5 years ago
parent f03e5e239d
commit 07517ff30a

@ -16,14 +16,10 @@ server.tag = "Apache 1.3.29"
server.modules = (
"mod_fastcgi",
"mod_cgi",
"mod_accesslog",
)
######################## MODULE CONFIG ############################
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = (

@ -20,8 +20,6 @@ TESTS=\
CONFS=\
404-handler.conf \
bug-06.conf \
bug-12.conf \
cachable.t \
condition.conf \
core-404-handler.t \
@ -31,12 +29,11 @@ CONFS=\
core-response.t \
core-var-include.t \
fastcgi-10.conf \
fastcgi-13.conf \
fastcgi-auth.conf \
fastcgi-responder.conf \
LightyTest.pm \
lowercase.conf \
lowercase.t \
mod-auth.conf \
mod-auth.t \
mod-cgi.t \
mod-compress.conf \
@ -45,6 +42,7 @@ CONFS=\
mod-extforward.t \
mod-fastcgi.t \
mod-proxy.t \
mod-secdownload.conf \
mod-secdownload.t \
mod-setenv.t \
mod-ssi.t \

@ -5,11 +5,7 @@ tests = Split('prepare.sh \
cleanup.sh')
extra_dist = Split('fastcgi-10.conf \
fastcgi-auth.conf \
fastcgi-responder.conf \
fastcgi-13.conf \
bug-06.conf \
bug-12.conf \
core-var-include.t \
var-include.conf \
var-include-sub.conf \
@ -18,6 +14,7 @@ extra_dist = Split('fastcgi-10.conf \
core-request.t \
core-response.t \
core-keepalive.t \
mod-auth.conf \
mod-auth.t \
mod-cgi.t \
mod-compress.t \

@ -1,139 +0,0 @@
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
## bind to port (default: 80)
server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
server.dir-listing = "enable"
server.modules = (
"mod_rewrite",
"mod_setenv",
"mod_access",
"mod_auth",
"mod_authn_file",
"mod_status",
"mod_expire",
"mod_simple_vhost",
"mod_redirect",
"mod_fastcgi",
"mod_compress",
"mod_accesslog",
)
server.indexfiles = (
"index.html",
"index.htm",
"default.htm",
"index.php",
)
######################## MODULE CONFIG ############################
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = (
".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
".html" => "text/html",
".htm" => "text/html",
".pdf" => "application/pdf",
".swf" => "application/x-shockwave-flash",
".spl" => "application/futuresplash",
".txt" => "text/plain",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".gz" => "application/x-gzip",
".c" => "text/plain",
".conf" => "text/plain",
)
compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
compress.filetype = (
"text/plain",
"text/html",
)
setenv.add-environment = (
"TRAC_ENV" => "foo",
)
setenv.add-request-header = (
"FOO" => "foo",
)
setenv.add-response-header = (
"BAR" => "foo",
)
fastcgi.debug = 0
fastcgi.server = ( ".php" => (
"grisu" => (
"host" => "127.0.0.1",
"port" => 1026,
),
))
auth.backend = "plain"
auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
#auth.backend.ldap.hostname = "localhost"
#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
#auth.backend.ldap.filter = "(uid=$)"
auth.require = (
"/server-status" => (
"method" => "digest",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
"/auth.php" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "user=jan",
),
"/server-config" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
)
url.access-deny = (
"~",
".inc",
)
url.redirect = (
"^/redirect/$" => "http://localhost:2048/",
)
expire.url = (
"/buggy/" => "access 2 hours",
"/asdhas/" => "access plus 1 seconds 2 minutes",
)
#### status module
status.status-url = "/server-status"
status.config-url = "/server-config"
simple-vhost.document-root = "pages"
simple-vhost.server-root = env.SRCDIR + "/tmp/lighttpd/servers/"
simple-vhost.default-host = "www.example.org"
$HTTP["host"] == "vvv.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}

@ -1,141 +0,0 @@
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
## bind to port (default: 80)
server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
server.dir-listing = "enable"
server.modules = (
"mod_rewrite",
"mod_setenv",
"mod_access",
"mod_auth",
"mod_authn_file",
"mod_status",
"mod_expire",
"mod_simple_vhost",
"mod_redirect",
"mod_fastcgi",
"mod_compress",
"mod_accesslog",
)
server.indexfiles = (
"index.html",
"index.htm",
"default.htm",
"index.php",
)
server.error-handler-404 = "/indexfile/return-404.php"
######################## MODULE CONFIG ############################
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = (
".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
".html" => "text/html",
".htm" => "text/html",
".pdf" => "application/pdf",
".swf" => "application/x-shockwave-flash",
".spl" => "application/futuresplash",
".txt" => "text/plain",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".gz" => "application/x-gzip",
".c" => "text/plain",
".conf" => "text/plain",
)
compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
compress.filetype = (
"text/plain",
"text/html",
)
setenv.add-environment = (
"TRAC_ENV" => "foo",
)
setenv.add-request-header = (
"FOO" => "foo",
)
setenv.add-response-header = (
"BAR" => "foo",
)
fastcgi.debug = 0
fastcgi.server = ( ".php" => (
"grisu" => (
"host" => "127.0.0.1",
"port" => 1026,
),
))
auth.backend = "plain"
auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
#auth.backend.ldap.hostname = "localhost"
#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
#auth.backend.ldap.filter = "(uid=$)"
auth.require = (
"/server-status" => (
"method" => "digest",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
"/auth.php" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "user=jan",
),
"/server-config" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
)
url.access-deny = (
"~",
".inc",
)
url.redirect = (
"^/redirect/$" => "http://localhost:2048/",
)
expire.url = (
"/buggy/" => "access 2 hours",
"/asdhas/" => "access plus 1 seconds 2 minutes",
)
#### status module
status.status-url = "/server-status"
status.config-url = "/server-config"
simple-vhost.document-root = "pages"
simple-vhost.server-root = env.SRCDIR + "/tmp/lighttpd/servers/"
simple-vhost.default-host = "www.example.org"
$HTTP["host"] == "vvv.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}

@ -14,8 +14,6 @@ use LightyTest;
my $tf = LightyTest->new();
my $t;
$tf->{CONFIGFILE} = 'lighttpd.conf';
ok($tf->start_proc == 0, "Starting lighttpd") or die();
## check if If-Modified-Since, If-None-Match works

@ -20,9 +20,6 @@ server.modules = (
"mod_accesslog",
)
######################## MODULE CONFIG ############################
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = (

@ -1 +1 @@
EXTRA_DIST=index.php return-404.php rewrite.php
EXTRA_DIST=index.php return-404.php query_string.pl

@ -0,0 +1,3 @@
#!/usr/bin/env perl
print "Status: 200\n\n$ENV{QUERY_STRING}"

@ -1,3 +0,0 @@
<?php
print $_SERVER["QUERY_STRING"];
?>

@ -10,121 +10,76 @@ server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
server.dir-listing = "enable"
server.modules = (
"mod_rewrite",
"mod_access",
"mod_auth",
"mod_authn_file",
"mod_status",
"mod_expire",
"mod_redirect",
"mod_fastcgi",
"mod_cgi",
"mod_compress",
"mod_accesslog",
)
server.indexfiles = (
"index.php",
"index.html",
"index.htm",
"default.htm",
)
######################## MODULE CONFIG ############################
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = (
".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
".html" => "text/html",
".htm" => "text/html",
".pdf" => "application/pdf",
".swf" => "application/x-shockwave-flash",
".spl" => "application/futuresplash",
".txt" => "text/plain",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".gz" => "application/x-gzip",
".c" => "text/plain",
".conf" => "text/plain",
)
$HTTP["host"] == "bin-env.example.org" {
compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
compress.filetype = (
"text/plain",
"text/html",
)
fastcgi.debug = 0
fastcgi.server = (
".php" => (
"grisu" => (
"host" => "127.0.0.1",
"port" => 1026,
"port" => 1048,
"bin-path" => env.PHP,
"bin-copy-environment" => ( "PATH", "SHELL", "USER", ),
),
),
)
cgi.assign = (
".pl" => env.PERL,
".cgi" => env.PERL,
)
auth.backend = "plain"
auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
#auth.backend.ldap.hostname = "localhost"
#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
#auth.backend.ldap.filter = "(uid=$)"
auth.require = (
"/server-status" => (
"method" => "digest",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
"/auth.php" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "user=jan",
),
"/server-config" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
)
}
else {
url.access-deny = (
"~",
".inc",
fastcgi.debug = 0
fastcgi.server = (
".php" => ( (
"host" => "127.0.0.1",
"port" => 1026,
"broken-scriptfilename" => "enable",
"allow-x-send-file" => "enable",
) ),
"/prefix.fcgi" => ( (
"host" => "127.0.0.1",
"port" => 1026,
"check-local" => "disable",
"broken-scriptfilename" => "enable",
) ),
)
url.redirect = (
"^/redirect/$" => "http://localhost:2048/",
)
}
expire.url = (
"/buggy/" => "access 2 hours",
"/asdhas/" => "access plus 1 seconds 2 minutes",
)
server.error-handler-404 = "/indexfile/return-404.php"
#### status module
status.status-url = "/server-status"
status.config-url = "/server-config"
$HTTP["host"] == "zzz.example.org" {
server.name = "zzz.example.org"
}
$HTTP["host"] == "vvv.example.org" {
$HTTP["host"] == "auth.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "auth.example.org"
auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
auth.backend = "htpasswd"
auth.require = (
"" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "valid-user",
),
)
}
$HTTP["host"] == "zzz.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
$HTTP["host"] == "www.example.org" {
$HTTP["url"] == "/go/" {
server.indexfiles = ( "cgi.php" )
}
}

@ -1,137 +0,0 @@
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
debug.log-request-header = "enable"
debug.log-response-header = "enable"
debug.log-request-handling = "enable"
## bind to port (default: 80)
server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
server.dir-listing = "enable"
server.modules = (
"mod_rewrite",
"mod_access",
"mod_auth",
"mod_authn_file",
"mod_status",
"mod_expire",
"mod_redirect",
"mod_fastcgi",
"mod_cgi",
"mod_compress",
"mod_accesslog"
)
server.indexfiles = (
"index.php",
"index.html",
"index.htm",
"default.htm",
)
######################## MODULE CONFIG ############################
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = (
".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
".html" => "text/html",
".htm" => "text/html",
".pdf" => "application/pdf",
".swf" => "application/x-shockwave-flash",
".spl" => "application/futuresplash",
".txt" => "text/plain",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".gz" => "application/x-gzip",
".c" => "text/plain",
".conf" => "text/plain",
)
compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
compress.filetype = (
"text/plain",
"text/html",
)
fastcgi.debug = 0
fastcgi.server = (
".php" => (
"grisu" => (
"host" => "127.0.0.1",
"port" => 1048,
"bin-path" => env.PHP,
"bin-copy-environment" => ( "PATH", "SHELL", "USER", ),
),
),
)
cgi.assign = (
".pl" => env.PERL,
".cgi" => env.PERL,
)
auth.backend = "plain"
auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
#auth.backend.ldap.hostname = "localhost"
#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
#auth.backend.ldap.filter = "(uid=$)"
auth.require = (
"/server-status" => (
"method" => "digest",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
"/auth.php" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "user=jan",
),
"/server-config" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
)
url.access-deny = (
"~",
".inc",
)
url.redirect = (
"^/redirect/$" => "http://localhost:2048/",
)
expire.url = (
"/buggy/" => "access 2 hours",
"/asdhas/" => "access plus 1 seconds 2 minutes",
)
#### status module
status.status-url = "/server-status"
status.config-url = "/server-config"
$HTTP["host"] == "vvv.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}

@ -1,147 +0,0 @@
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
debug.log-request-header = "enable"
debug.log-response-header = "enable"
debug.log-request-handling = "enable"
## bind to port (default: 80)
server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
server.dir-listing = "enable"
server.modules = (
"mod_rewrite",
"mod_access",
"mod_auth",
"mod_authn_file",
"mod_status",
"mod_expire",
"mod_redirect",
"mod_fastcgi",
"mod_cgi",
"mod_compress",
"mod_accesslog",
)
server.indexfiles = (
"index.php",
"index.html",
"index.htm",
"default.htm",
)
######################## MODULE CONFIG ############################
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = (
".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
".html" => "text/html",
".htm" => "text/html",
".pdf" => "application/pdf",
".swf" => "application/x-shockwave-flash",
".spl" => "application/futuresplash",
".txt" => "text/plain",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".gz" => "application/x-gzip",
".c" => "text/plain",
".conf" => "text/plain",
)
compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
compress.filetype = (
"text/plain",
"text/html",
)
fastcgi.debug = 0
fastcgi.server = (
"/" => (
"grisu-auth" => (
"host" => "127.0.0.1",
"port" => 20000,
"bin-path" => env.SRCDIR + "/fcgi-auth",
"mode" => "authorizer",
"check-local" => "disable",
),
"grisu-resp" => (
"host" => "127.0.0.1",
"port" => 10000,
"bin-path" => env.SRCDIR + "/fcgi-responder",
"check-local" => "disable",
"max-procs" => 1,
),
),
)
cgi.assign = (
".pl" => env.PERL,
".cgi" => env.PERL,
)
auth.backend = "plain"
auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
#auth.backend.ldap.hostname = "localhost"
#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
#auth.backend.ldap.filter = "(uid=$)"
auth.require = (
"/server-status" => (
"method" => "digest",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
"/auth.php" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "user=jan",
),
"/server-config" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
)
url.access-deny = (
"~",
".inc",
)
url.redirect = (
"^/redirect/$" => "http://localhost:2048/",
)
expire.url = (
"/buggy/" => "access 2 hours",
"/asdhas/" => "access plus 1 seconds 2 minutes",
)
#### status module
status.status-url = "/server-status"
status.config-url = "/server-config"
$HTTP["host"] == "vvv.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}

@ -1,11 +1,8 @@
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
#debug.log-request-header = "enable"
#debug.log-response-header = "enable"
#debug.log-request-handling = "enable"
#debug.log-state-handling = "enable"
#fastcgi.debug = 1
debug.log-request-header = "enable"
debug.log-response-header = "enable"
debug.log-request-handling = "enable"
## bind to port (default: 80)
server.port = 2048
@ -17,58 +14,43 @@ server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
server.dir-listing = "enable"
server.modules = (
"mod_rewrite",
"mod_access",
"mod_auth",
"mod_authn_file",
"mod_status",
"mod_expire",
"mod_redirect",
"mod_fastcgi",
"mod_cgi",
"mod_compress",
"mod_accesslog",
)
server.indexfiles = (
"index.php",
"index.html",
"index.htm",
"default.htm",
)
######################## MODULE CONFIG ############################
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = (
".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
".html" => "text/html",
".htm" => "text/html",
".pdf" => "application/pdf",
".swf" => "application/x-shockwave-flash",
".spl" => "application/futuresplash",
".txt" => "text/plain",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".gz" => "application/x-gzip",
".c" => "text/plain",
".conf" => "text/plain",
)
$HTTP["host"] == "auth.example.org" {
compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
compress.filetype = (
"text/plain",
"text/html",
fastcgi.debug = 0
fastcgi.server = (
"/" => (
"grisu-auth" => (
"host" => "127.0.0.1",
"port" => 20000,
"bin-path" => env.SRCDIR + "/fcgi-auth",
"mode" => "authorizer",
"check-local" => "disable",
),
"grisu-resp" => (
"host" => "127.0.0.1",
"port" => 10000,
"bin-path" => env.SRCDIR + "/fcgi-responder",
"check-local" => "disable",
"max-procs" => 1,
),
),
)
}
else {
fastcgi.debug = 0
fastcgi.server = (
".fcgi" => (
@ -83,61 +65,9 @@ fastcgi.server = (
),
)
cgi.assign = (
".pl" => env.PERL,
".cgi" => env.PERL,
)
auth.backend = "plain"
auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
#auth.backend.ldap.hostname = "localhost"
#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
#auth.backend.ldap.filter = "(uid=$)"
auth.require = (
"/server-status" => (
"method" => "digest",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
"/auth.php" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "user=jan",
),
"/server-config" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
)
url.access-deny = (
"~",
".inc",
)
url.redirect = (
"^/redirect/$" => "http://localhost:2048/",
)
expire.url = (
"/buggy/" => "access 2 hours",
"/asdhas/" => "access plus 1 seconds 2 minutes",
)
#### status module
status.status-url = "/server-status"
status.config-url = "/server-config"
$HTTP["host"] == "vvv.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}

@ -20,33 +20,20 @@ server.tag = "Apache 1.3.29"
server.dir-listing = "enable"
server.modules = (
"mod_rewrite",
"mod_setenv",
"mod_secdownload",
"mod_access",
"mod_auth",
"mod_authn_file",
"mod_status",
"mod_expire",
"mod_simple_vhost",
"mod_redirect",
"mod_fastcgi",
"mod_cgi",
"mod_compress",
"mod_userdir",
"mod_ssi",
"mod_accesslog",
)
server.indexfiles = (
"index.php",
"index.html",
"index.htm",
"default.htm",
)
######################## MODULE CONFIG ############################
ssi.extension = (
".shtml",
)
@ -71,14 +58,6 @@ mimetype.assign = (
".conf" => "text/plain",
)
$HTTP["host"] == "cache.example.org" {
compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
}
compress.filetype = (
"text/plain",
"text/html",
)
setenv.add-environment = (
"TRAC_ENV" => "tracenv",
"SETENV" => "setenv",
@ -103,22 +82,6 @@ $HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}
fastcgi.debug = 0
fastcgi.server = (
".php" => ( (
"host" => "127.0.0.1",
"port" => 1026,
"broken-scriptfilename" => "enable",
"allow-x-send-file" => "enable",
) ),
"/prefix.fcgi" => ( (
"host" => "127.0.0.1",
"port" => 1026,
"check-local" => "disable",
"broken-scriptfilename" => "enable",
) ),
)
cgi.local-redir = "enable"
cgi.assign = (
".pl" => env.PERL,
@ -130,79 +93,16 @@ userdir.include-user = (
)
userdir.path = "/"
$HTTP["host"] == "auth-htpasswd.example.org" {
auth.backend = "htpasswd"
}
auth.backend = "plain"
auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
auth.require = (
"/server-status" => (
"method" => "digest",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
"/server-config" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "valid-user",
),
)
url.access-deny = (
"~",
".inc",
)
url.rewrite = (
"^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1",
"^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1",
)
url.rewrite-if-not-file = (
"^(/rewrite/[^?]*)(?:\?(.*))?$" => "/indexfile/rewrite.php?file=$1&$2",
)
expire.url = (
"/expire/access" => "access 2 hours",
"/expire/modification" => "access plus 1 seconds 2 minutes",
)
#### status module
status.status-url = "/server-status"
status.config-url = "/server-config"
$HTTP["host"] == "vvv.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
secdownload.secret = "verysecret"
secdownload.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
secdownload.uri-prefix = "/sec/"
secdownload.timeout = 120
secdownload.algorithm = "md5"
}
$HTTP["host"] == "vvv-sha1.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
secdownload.secret = "verysecret"
secdownload.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
secdownload.uri-prefix = "/sec/"
secdownload.timeout = 120
secdownload.algorithm = "hmac-sha1"
}
$HTTP["host"] == "vvv-sha256.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
secdownload.secret = "verysecret"
secdownload.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
secdownload.uri-prefix = "/sec/"
secdownload.timeout = 120
secdownload.algorithm = "hmac-sha256"
secdownload.hash-querystr = "enable"
}
$HTTP["host"] == "zzz.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
@ -232,19 +132,6 @@ $HTTP["host"] !~ "(no-simple\.example\.org)" {
simple-vhost.default-host = "www.example.org"
}
$HTTP["host"] == "auth.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "auth.example.org"
auth.backend = "htpasswd"
auth.require = (
"" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "valid-user",
),
)
}
$HTTP["host"] =~ "bug255\.example\.org$" {
$HTTP["remoteip"] == "127.0.0.1" {
url.access-deny = (

@ -10,10 +10,7 @@ server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.
server.force-lowercase-filenames = "enable"
server.dir-listing = "enable"
server.modules = (
"mod_rewrite",
"mod_setenv",
"mod_secdownload",
"mod_access",
@ -21,21 +18,15 @@ server.modules = (
"mod_authn_file",
"mod_status",
"mod_expire",
"mod_redirect",
"mod_fastcgi",
"mod_cgi",
)
server.indexfiles = (
"index.php",
"index.html",
"index.htm",
"default.htm",
)
######################## MODULE CONFIG ############################
mimetype.assign = (
".png" => "image/png",
".jpg" => "image/jpeg",
@ -54,21 +45,6 @@ mimetype.assign = (
".conf" => "text/plain",
)
fastcgi.debug = 0
fastcgi.server = (
".php" => ( (
"host" => "127.0.0.1",
"port" => 1026,
"broken-scriptfilename" => "enable",
) ),
"/prefix.fcgi" => ( (
"host" => "127.0.0.1",
"port" => 1026,
"check-local" => "disable",
"broken-scriptfilename" => "enable",
) ),
)
cgi.assign = (
".pl" => env.PERL,
".cgi" => env.PERL,

@ -0,0 +1,49 @@
debug.log-request-handling = "enable"
debug.log-request-header = "enable"
debug.log-response-header = "enable"
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
## bind to port (default: 80)
server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
server.modules = (
"mod_auth",
"mod_authn_file",
"mod_status",
"mod_accesslog",
)
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
$HTTP["host"] == "auth-htpasswd.example.org" {
auth.backend = "htpasswd"
}
auth.backend = "plain"
auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
auth.require = (
"/server-status" => (
"method" => "digest",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10",
),
"/server-config" => (
"method" => "basic",
"realm" => "download archiv",
"require" => "valid-user",
),
)
status.status-url = "/server-status"
status.config-url = "/server-config"

@ -14,6 +14,7 @@ use LightyTest;
my $tf = LightyTest->new();
my $t;
$tf->{CONFIGFILE} = 'mod-auth.conf';
ok($tf->start_proc == 0, "Starting lighttpd") or die();
$t->{REQUEST} = ( <<EOF

@ -18,8 +18,6 @@ server.modules = (
"mod_compress",
)
######################## MODULE CONFIG ############################
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain; charset=utf-8",
@ -28,6 +26,7 @@ mimetype.assign = (
$HTTP["host"] == "cache.example.org" {
compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
}
compress.filetype = (
"text/plain",
"text/html",

@ -19,8 +19,6 @@ server.modules = (
"mod_extforward",
)
######################## MODULE CONFIG ############################
mimetype.assign = (
".html" => "text/html",
)

@ -7,7 +7,7 @@ BEGIN {
}
use strict;
use Test::More tests => 59;
use Test::More tests => 48;
use LightyTest;
my $tf = LightyTest->new();
@ -22,8 +22,9 @@ SKIP: {
}
SKIP: {
skip "no PHP running on port 1026", 35 unless $tf->listening_on(1026);
skip "no PHP running on port 1026", 34 unless $tf->listening_on(1026);
$tf->{CONFIGFILE} = 'fastcgi-10.conf';
ok($tf->start_proc == 0, "Starting lighttpd") or goto cleanup;
$t->{REQUEST} = ( <<EOF
@ -114,14 +115,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ];
ok($tf->handle_http($t) == 0, 'SERVER_NAME');
$t->{REQUEST} = ( <<EOF
GET /get-server-env.php?env=SERVER_NAME HTTP/1.0
Host: zzz.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ];
ok($tf->handle_http($t) == 0, 'SERVER_NAME');
$t->{REQUEST} = ( <<EOF
GET /cgi.php/abc HTTP/1.0
EOF
@ -207,12 +200,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'Basic' } ];
ok($tf->handle_http($t) == 0, '$_SERVER["AUTH_TYPE"]');
ok($tf->stop_proc == 0, "Stopping lighttpd");
$tf->{CONFIGFILE} = 'fastcgi-10.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or goto cleanup;
$t->{REQUEST} = ( <<EOF
GET /get-server-env.php?env=SERVER_NAME HTTP/1.0
Host: zzz.example.org
@ -229,10 +216,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'zzz.example.org' } ];
ok($tf->handle_http($t) == 0, 'SERVER_NAME (absolute url in request line)');
ok($tf->stop_proc == 0, "Stopping lighttpd");
$tf->{CONFIGFILE} = 'bug-06.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or goto cleanup;
$t->{REQUEST} = ( <<EOF
GET /indexfile/ HTTP/1.0
Host: www.example.org
@ -241,10 +224,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/indexfile/index.php' } ];
ok($tf->handle_http($t) == 0, 'Bug #6');
ok($tf->stop_proc == 0, "Stopping lighttpd");
$tf->{CONFIGFILE} = 'bug-12.conf';
ok($tf->start_proc == 0, "Starting lighttpd with bug-12.conf") or goto cleanup;
$t->{REQUEST} = ( <<EOF
POST /indexfile/abc HTTP/1.0
Host: www.example.org
@ -254,6 +233,31 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => '/indexfile/return-404.php' } ];
ok($tf->handle_http($t) == 0, 'Bug #12');
$t->{REQUEST} = ( <<EOF
GET /indexfile/index.php HTTP/1.0
Host: bin-env.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'FastCGI + local spawning');
$t->{REQUEST} = ( <<EOF
HEAD /indexfile/index.php HTTP/1.0
Host: bin-env.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-Content-Length' => '0' } ];
# Of course a valid content-length != 0 would be ok, but we assume for now that such one is not generated.
ok($tf->handle_http($t) == 0, 'Check for buggy content length with HEAD');
$t->{REQUEST} = ( <<EOF
GET /get-env.php?env=MAIL HTTP/1.0
Host: bin-env.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 , 'HTTP-Content' => '' } ];
ok($tf->handle_http($t) == 0, 'FastCGI + bin-copy-environment');
ok($tf->stop_proc == 0, "Stopping lighttpd");
}
@ -264,13 +268,15 @@ SKIP: {
}
SKIP: {
skip "no fcgi-auth found", 7 unless -x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe";
skip "no fcgi-auth, fcgi-responder found", 15
unless (-x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe")
&& (-x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe");
$tf->{CONFIGFILE} = 'fastcgi-auth.conf';
$tf->{CONFIGFILE} = 'fastcgi-responder.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
$t->{REQUEST} = ( <<EOF
GET /index.html?ok HTTP/1.0
Host: www.example.org
Host: auth.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
@ -278,7 +284,7 @@ EOF
$t->{REQUEST} = ( <<EOF
GET /index.html?fail HTTP/1.0
Host: www.example.org
Host: auth.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
@ -286,7 +292,7 @@ EOF
$t->{REQUEST} = ( <<EOF
GET /expire/access.txt?ok HTTP/1.0
Host: www.example.org
Host: auth.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
@ -294,7 +300,7 @@ EOF
$t->{REQUEST} = ( <<EOF
GET /index.fcgi?varfail HTTP/1.0
Host: www.example.org
Host: auth.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
@ -302,56 +308,12 @@ EOF
$t->{REQUEST} = ( <<EOF
GET /index.fcgi?var HTTP/1.0
Host: www.example.org
Host: auth.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'LighttpdTestContent' } ];
ok($tf->handle_http($t) == 0, 'FastCGI - Auth Success with Variable- to Env expansion');
ok($tf->stop_proc == 0, "Stopping lighttpd");
}
SKIP: {
skip "no php found", 5 unless $LightyTest::HAVE_PHP;
$tf->{CONFIGFILE} = 'fastcgi-13.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
$t->{REQUEST} = ( <<EOF
GET /indexfile/index.php HTTP/1.0
Host: www.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'FastCGI + local spawning');
$t->{REQUEST} = ( <<EOF
HEAD /indexfile/index.php HTTP/1.0
Host: www.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-Content-Length' => '0' } ];
# Of course a valid content-length != 0 would be ok, but we assume for now that such one is not generated.
ok($tf->handle_http($t) == 0, 'Check for buggy content length with HEAD');
$t->{REQUEST} = ( <<EOF
GET /get-env.php?env=MAIL HTTP/1.0
Host: www.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 , 'HTTP-Content' => '' } ];
ok($tf->handle_http($t) == 0, 'FastCGI + bin-copy-environment');
ok($tf->stop_proc == 0, "Stopping lighttpd");
}
SKIP: {
skip "no fcgi-responder found", 10 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe";
$tf->{CONFIGFILE} = 'fastcgi-responder.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
$t->{REQUEST} = ( <<EOF
GET /index.fcgi?lf HTTP/1.0
Host: www.example.org

@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
use Test::More tests => 9;
use Test::More tests => 7;
use LightyTest;
my $tf_real = LightyTest->new();
@ -17,12 +17,6 @@ my $tf_proxy = LightyTest->new();
my $t;
my $php_child = -1;
SKIP: {
skip "PHP already running on port 1026", 1 if $tf_real->listening_on(1026);
skip "no php binary found", 1 unless $LightyTest::HAVE_PHP;
ok(-1 != ($php_child = $tf_real->spawnfcgi($ENV{'PHP'}, 1026)), "Spawning php");
}
## we need two procs
## 1. the real webserver
## 2. the proxy server
@ -53,8 +47,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Server' => 'Apache 1.3.29' } ];
ok($tf_proxy->handle_http($t) == 0, 'drop Server from real server');
SKIP: {
skip "no PHP running on port 1026", 1 unless $tf_real->listening_on(1026);
$t->{REQUEST} = ( <<EOF
GET /rewrite/all/some+test%3axxx%20with%20space HTTP/1.0
Host: www.example.org
@ -62,18 +54,11 @@ EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/some+test%3axxx%20with%20space' } ];
ok($tf_proxy->handle_http($t) == 0, 'rewrited urls work with encoded path');
}
ok($tf_proxy->stop_proc == 0, "Stopping lighttpd proxy");
ok($tf_real->stop_proc == 0, "Stopping lighttpd");
SKIP: {
skip "PHP not started, cannot stop it", 1 unless $php_child != -1;
ok(0 == $tf_real->endspawnfcgi($php_child), "Stopping php");
$php_child = -1;
}
exit 0;
cleanup: