diff --git a/tests/404-handler.conf b/tests/404-handler.conf index e10a2697..2009e6eb 100644 --- a/tests/404-handler.conf +++ b/tests/404-handler.conf @@ -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 = ( diff --git a/tests/Makefile.am b/tests/Makefile.am index 8716b5d1..1582be86 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 \ diff --git a/tests/SConscript b/tests/SConscript index c476f33c..1b14569d 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -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 \ diff --git a/tests/bug-06.conf b/tests/bug-06.conf deleted file mode 100644 index 9595f592..00000000 --- a/tests/bug-06.conf +++ /dev/null @@ -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" -} diff --git a/tests/bug-12.conf b/tests/bug-12.conf deleted file mode 100644 index dda44238..00000000 --- a/tests/bug-12.conf +++ /dev/null @@ -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" -} diff --git a/tests/cachable.t b/tests/cachable.t index cd47eb2d..d0790e0e 100755 --- a/tests/cachable.t +++ b/tests/cachable.t @@ -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 diff --git a/tests/condition.conf b/tests/condition.conf index 7e1c5cae..c89ccd06 100644 --- a/tests/condition.conf +++ b/tests/condition.conf @@ -20,9 +20,6 @@ server.modules = ( "mod_accesslog", ) -######################## MODULE CONFIG ############################ - - accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( diff --git a/tests/docroot/www/indexfile/Makefile.am b/tests/docroot/www/indexfile/Makefile.am index 04727308..333c0c56 100644 --- a/tests/docroot/www/indexfile/Makefile.am +++ b/tests/docroot/www/indexfile/Makefile.am @@ -1 +1 @@ -EXTRA_DIST=index.php return-404.php rewrite.php +EXTRA_DIST=index.php return-404.php query_string.pl diff --git a/tests/docroot/www/indexfile/query_string.pl b/tests/docroot/www/indexfile/query_string.pl new file mode 100755 index 00000000..b775f6f6 --- /dev/null +++ b/tests/docroot/www/indexfile/query_string.pl @@ -0,0 +1,3 @@ +#!/usr/bin/env perl + +print "Status: 200\n\n$ENV{QUERY_STRING}" diff --git a/tests/docroot/www/indexfile/rewrite.php b/tests/docroot/www/indexfile/rewrite.php deleted file mode 100644 index fb412907..00000000 --- a/tests/docroot/www/indexfile/rewrite.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/tests/fastcgi-10.conf b/tests/fastcgi-10.conf index 293ce854..7c1ba539 100644 --- a/tests/fastcgi-10.conf +++ b/tests/fastcgi-10.conf @@ -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" ) + } } diff --git a/tests/fastcgi-13.conf b/tests/fastcgi-13.conf deleted file mode 100644 index 9c2ae57d..00000000 --- a/tests/fastcgi-13.conf +++ /dev/null @@ -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" -} diff --git a/tests/fastcgi-auth.conf b/tests/fastcgi-auth.conf deleted file mode 100644 index a1fc5848..00000000 --- a/tests/fastcgi-auth.conf +++ /dev/null @@ -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" -} - diff --git a/tests/fastcgi-responder.conf b/tests/fastcgi-responder.conf index 5e1f9ea8..705c3cac 100644 --- a/tests/fastcgi-responder.conf +++ b/tests/fastcgi-responder.conf @@ -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" } diff --git a/tests/lighttpd.conf b/tests/lighttpd.conf index f4454f95..4c8f9677 100644 --- a/tests/lighttpd.conf +++ b/tests/lighttpd.conf @@ -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 = ( diff --git a/tests/lowercase.conf b/tests/lowercase.conf index 27be7408..39215ba4 100644 --- a/tests/lowercase.conf +++ b/tests/lowercase.conf @@ -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, diff --git a/tests/mod-auth.conf b/tests/mod-auth.conf new file mode 100644 index 00000000..a2846bf3 --- /dev/null +++ b/tests/mod-auth.conf @@ -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" diff --git a/tests/mod-auth.t b/tests/mod-auth.t index bed0b875..55719b11 100755 --- a/tests/mod-auth.t +++ b/tests/mod-auth.t @@ -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} = ( < "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", diff --git a/tests/mod-extforward.conf b/tests/mod-extforward.conf index c8e51017..caa66630 100644 --- a/tests/mod-extforward.conf +++ b/tests/mod-extforward.conf @@ -19,8 +19,6 @@ server.modules = ( "mod_extforward", ) -######################## MODULE CONFIG ############################ - mimetype.assign = ( ".html" => "text/html", ) diff --git a/tests/mod-fastcgi.t b/tests/mod-fastcgi.t index 884acf70..2ec4eba7 100755 --- a/tests/mod-fastcgi.t +++ b/tests/mod-fastcgi.t @@ -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} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ]; ok($tf->handle_http($t) == 0, 'SERVER_NAME'); - $t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ]; - ok($tf->handle_http($t) == 0, 'SERVER_NAME'); - $t->{REQUEST} = ( <{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} = ( <{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} = ( <{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} = ( <{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} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; + ok($tf->handle_http($t) == 0, 'FastCGI + local spawning'); + + $t->{REQUEST} = ( <{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} = ( <{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} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; @@ -278,7 +284,7 @@ EOF $t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ]; @@ -286,7 +292,7 @@ EOF $t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; @@ -294,7 +300,7 @@ EOF $t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ]; @@ -302,56 +308,12 @@ EOF $t->{REQUEST} = ( <{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} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; - ok($tf->handle_http($t) == 0, 'FastCGI + local spawning'); - - $t->{REQUEST} = ( <{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} = ( <{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} = ( < 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} = ( <{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: diff --git a/tests/mod-secdownload.conf b/tests/mod-secdownload.conf new file mode 100644 index 00000000..c857340f --- /dev/null +++ b/tests/mod-secdownload.conf @@ -0,0 +1,50 @@ +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_secdownload", + "mod_accesslog", +) + +accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log" + +$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" +} diff --git a/tests/mod-secdownload.t b/tests/mod-secdownload.t index 8881df68..91276cdd 100755 --- a/tests/mod-secdownload.t +++ b/tests/mod-secdownload.t @@ -17,6 +17,7 @@ use MIME::Base64 qw(encode_base64url); my $tf = LightyTest->new(); my $t; +$tf->{CONFIGFILE} = 'mod-secdownload.conf'; ok($tf->start_proc == 0, "Starting lighttpd") or die(); my $secret = "verysecret"; diff --git a/tests/prepare.sh b/tests/prepare.sh index 32dd2b8f..f2fc3b83 100755 --- a/tests/prepare.sh +++ b/tests/prepare.sh @@ -38,6 +38,7 @@ cp "${srcdir}/docroot/www/"*.html \ cp "${srcdir}/docroot/www/go/"*.php "${tmpdir}/servers/www.example.org/pages/go/" cp "${srcdir}/docroot/www/expire/"*.txt "${tmpdir}/servers/www.example.org/pages/expire/" cp "${srcdir}/docroot/www/indexfile/"*.php "${tmpdir}/servers/www.example.org/pages/indexfile/" +cp "${srcdir}/docroot/www/indexfile/"*.pl "${tmpdir}/servers/www.example.org/pages/indexfile/" cp "${srcdir}/docroot/123/"*.txt \ "${srcdir}/docroot/123/"*.html \ "${srcdir}/docroot/123/"*.php \ diff --git a/tests/proxy.conf b/tests/proxy.conf index 72b010ad..0ca8ec78 100644 --- a/tests/proxy.conf +++ b/tests/proxy.conf @@ -10,61 +10,15 @@ server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage. server.name = "www.example.org" server.tag = "Proxy" -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_proxy", - "mod_cgi", - "mod_compress", - "mod_userdir", "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", -) - setenv.add-environment = ( "TRAC_ENV" => "foo", ) @@ -83,82 +37,6 @@ proxy.server = ( "" => ( ), )) -cgi.assign = ( - ".pl" => env.PERL, - ".cgi" => env.PERL, -) - -userdir.include-user = ( - "jan", -) -userdir.path = "/" - -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/", -) - url.rewrite = ( - "^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1", - "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1", - "^/rewrite/all(/.*)$" => "/indexfile/rewrite.php?$1", + "^/rewrite/all(/.*)$" => "/indexfile/query_string.pl?$1", ) - -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/" -} - -$HTTP["host"] == "zzz.example.org" { - server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/" - server.name = "zzz.example.org" -} - -$HTTP["host"] == "no-simple.example.org" { - server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/123.example.org/pages/" - server.name = "zzz.example.org" -} - -$HTTP["host"] !~ "(no-simple\.example\.org)" { - simple-vhost.document-root = "pages" - simple-vhost.server-root = env.SRCDIR + "/tmp/lighttpd/servers/" - simple-vhost.default-host = "www.example.org" -} diff --git a/tests/scgi-responder.conf b/tests/scgi-responder.conf index 68a72c7a..969913d2 100644 --- a/tests/scgi-responder.conf +++ b/tests/scgi-responder.conf @@ -3,9 +3,6 @@ server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.o #debug.log-request-header = "enable" #debug.log-response-header = "enable" #debug.log-request-handling = "enable" -#debug.log-state-handling = "enable" - -#scgi.debug = 1 ## bind to port (default: 80) server.port = 2048 @@ -17,58 +14,13 @@ 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_scgi", - "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", -) - scgi.debug = 0 scgi.server = ( ".scgi" => ( @@ -83,64 +35,6 @@ scgi.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" -} - $HTTP["host"] == "wsgi.example.org" { scgi.server = ( "/" => ( ( diff --git a/tests/var-include.conf b/tests/var-include.conf index 35c42fe7..e134c790 100644 --- a/tests/var-include.conf +++ b/tests/var-include.conf @@ -20,8 +20,6 @@ server.modules = ( "mod_accesslog", ) -######################## MODULE CONFIG ############################ - accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( @@ -29,14 +27,14 @@ mimetype.assign = ( ) url.redirect = ( - "^" => "/default", + "" => "/default", ) $HTTP["host"] == "www.example.org" { server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/" server.name = "www.example.org" url.redirect = ( - "^" => "/redirect", + "" => "/redirect", ) }