git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@519 152afb58-edef-0310-8abb-c4023f1b3aa9svn/tags/lighttpd-1.4.2
parent
4d6933c0c1
commit
8073d5fe9f
@ -0,0 +1,59 @@
|
||||
|
||||
debug.log-request-handling = "enable"
|
||||
debug.log-condition-handling = "enable"
|
||||
|
||||
server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/"
|
||||
server.pid-file = "/tmp/lighttpd/lighttpd.pid"
|
||||
|
||||
## bind to port (default: 80)
|
||||
server.port = 2048
|
||||
|
||||
## bind to localhost (default: all interfaces)
|
||||
server.bind = "localhost"
|
||||
server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log"
|
||||
server.name = "www.example.org"
|
||||
server.tag = "Apache 1.3.29"
|
||||
|
||||
|
||||
server.modules = (
|
||||
"mod_access",
|
||||
"mod_accesslog" )
|
||||
|
||||
######################## MODULE CONFIG ############################
|
||||
|
||||
|
||||
accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log"
|
||||
|
||||
mimetype.assign = ( ".html" => "text/html" )
|
||||
|
||||
# ban first, unban later
|
||||
url.access-deny = ( "index.html" )
|
||||
|
||||
$HTTP["host"] == "www.example.org" {
|
||||
server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/"
|
||||
server.name = "www.example.org"
|
||||
}
|
||||
| $HTTP["host"] == "test1.example.org" {
|
||||
server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/"
|
||||
server.name = "test1.example.org"
|
||||
url.access-deny = ( "nothing" )
|
||||
}
|
||||
# comments
|
||||
| $HTTP["host"] == "test2.example.org" {
|
||||
server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/"
|
||||
server.name = "test2.example.org"
|
||||
url.access-deny = ( "nothing" )
|
||||
}
|
||||
|
||||
# comments
|
||||
|
||||
| $HTTP["host"] == "test3.example.org" {
|
||||
server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/"
|
||||
server.name = "test3.example.org"
|
||||
# comments
|
||||
url.access-deny = ( "nothing" )
|
||||
|
||||
$HTTP["url"] == "/index.html" {
|
||||
url.access-deny = ( "index.html" )
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
#! /usr/bin/perl -w
|
||||
BEGIN {
|
||||
# add current source dir to the include-path
|
||||
# we need this for make distcheck
|
||||
(my $srcdir = $0) =~ s#/[^/]+$#/#;
|
||||
unshift @INC, $srcdir;
|
||||
}
|
||||
|
||||
use strict;
|
||||
use IO::Socket;
|
||||
use Test::More tests => 6;
|
||||
use LightyTest;
|
||||
|
||||
my $tf = LightyTest->new();
|
||||
my $t;
|
||||
|
||||
$tf->{CONFIGFILE} = 'condition.conf';
|
||||
ok($tf->start_proc == 0, "Starting lighttpd") or die();
|
||||
|
||||
$t->{REQUEST} = ( <<EOF
|
||||
GET /index.html HTTP/1.0
|
||||
Host: www.example.org
|
||||
EOF
|
||||
);
|
||||
$t->{RESPONSE} = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } );
|
||||
ok($tf->handle_http($t) == 0, 'config deny');
|
||||
|
||||
$t->{REQUEST} = ( <<EOF
|
||||
GET /index.html HTTP/1.0
|
||||
Host: test1.example.org
|
||||
EOF
|
||||
);
|
||||
$t->{RESPONSE} = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } );
|
||||
ok($tf->handle_http($t) == 0, '2nd child of chaining');
|
||||
|
||||
$t->{REQUEST} = ( <<EOF
|
||||
GET /index.html HTTP/1.0
|
||||
Host: test2.example.org
|
||||
EOF
|
||||
);
|
||||
$t->{RESPONSE} = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } );
|
||||
ok($tf->handle_http($t) == 0, '3rd child of chaining');
|
||||
|
||||
$t->{REQUEST} = ( <<EOF
|
||||
GET /index.html HTTP/1.0
|
||||
Host: test3.example.org
|
||||
EOF
|
||||
);
|
||||
$t->{RESPONSE} = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } );
|
||||
ok($tf->handle_http($t) == 0, 'nesting');
|
||||
|
||||
ok($tf->stop_proc == 0, "Stopping lighttpd");
|
||||
|
Loading…
Reference in new issue