# GENERAL SETTINGS
ServerId = nobody
ConnectionsTotal = 500
ConnectionsPerIP = 10
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log
# BINDING SETTINGS
Binding {
Port = 80
TimeForRequest = 2, 25
}
# COMMON GATEWAY INTERFACE (CGI) SETTINGS
CGIextension = cgi
NoExtensionAs = cgi
ExecuteCGI = yes
TimeForCGI = 35
KillTimedoutCGI = yes
TriggerOnCGIstatus = yes
# DEFAULT WEBSITE
Hostname = 127.0.0.1
WebsiteRoot = /home/www
StartFile = index.cgi
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log
LogFormat = hiawatha
WrapUserCGI = yes
EnablePathInfo = yes
ErrorHandler = 404:/404.cgi
ShowIndex = yes
IndexStyle = /index.css
# VIRTUAL HOSTS
VirtualHost {
Hostname = www.domain-1.net,domain-1.net
WebsiteRoot = /home/www/domain-1.net
StartFile = index.cgi
ErrorHandler = 404:/domain-1.net/404.cgi
}
VirtualHost {
Hostname = www.domain-2.net,domain-2.net
WebsiteRoot = /home/www/domain-2.net
StartFile = index.cgi
ErrorHandler = 404:/domain-2.net/404.cgi
}
# DIRECTORY SETTINGS
Directory {
Path = /home/www/domain-1.net
ExecuteCGI = yes
UploadSpeed = 10,2
}
Directory {
Path = /home/www/domain-2.net
ExecuteCGI = yes
UploadSpeed = 10,2
}
Directory {
Path = /home/www/domain-3.net
ExecuteCGI = yes
UploadSpeed = 10,2
}
# BANNING SETTINGS
BanOnFlooding = 10/1:30
BanOnGarbage = 60
BanOnMaxPerIP = 6
BanOnMaxReqSize = 3
BanOnSQLi = 10800
BanOnTimeout = 10
BanOnWrongPassword = 4:300
KickOnBan = yes
RebanDuringBan = yes
BanOnCMDi = 60
BanlistMask = deny 192.168.0.0/16, deny 127.0.0.1
ReconnectDelay = 6
PreventXSS = yes
fprintf(stderr, "OKE\n");
sudo ./hiawatha -d
case 503:
if (session->data_sent == false) {
switch (handle_error(session, result)) {
case -1:
session->keep_alive = false;
break;
case 200:
break;
default:
if (session->data_sent == false) {
if (send_code(session, result) == -1) {
session->keep_alive = false;
}
}
}
}
break;
case 500:
session->keep_alive = false;
default:
if (session->data_sent == false) {
send_code(session, result);
}
}
case 501:
fprintf(stderr, "OKE-501\n");
case 503:
fprintf(stderr, "OKE-503\n");
if (session->data_sent == false) {
fprintf(stderr, "OKE-503a\n");
switch (handle_error(session, result)) {
case -1:
fprintf(stderr, "OKE-503b\n");
session->keep_alive = false;
fprintf(stderr, "OKE-503c\n");
break;
case 200:
fprintf(stderr, "OKE-503-200\n");
break;
default:
fprintf(stderr, "OKE-503-default-a\n");
if (session->data_sent == false) {
fprintf(stderr, "OKE-503-default-b\n");
if (send_code(session, result) == -1) {
fprintf(stderr, "OKE-503-default-c\n");
session->keep_alive = false;
}
fprintf(stderr, "OKE-503-default-d\n");
}
fprintf(stderr, "OKE-503-default-e\n");
}
fprintf(stderr, "OKE-503-default-f\n");
}
fprintf(stderr, "OKE-503-default-g\n");
break;
case 500:
fprintf(stderr, "OKE-500\n");
session->keep_alive = false;
default:
fprintf(stderr, "OKE-500-default-a\n");
if (session->data_sent == false) {
fprintf(stderr, "OKE-500-default-b\n");
send_code(session, result);
}
}
Press Ctrl-C to shutdown the Hiawatha webserver.
OKE-501
OKE-503
OKE-503a
*** glibc detected *** ./hiawatha: corrupted double-linked list: 0x0807b2a8 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7ca6149]
/lib/tls/i686/cmov/libc.so.6[0xb7ca7edd]
/lib/tls/i686/cmov/libc.so.6(__libc_malloc+0x8d)[0xb7ca9cad]
./hiawatha[0x804ad59]
./hiawatha[0x805f77f]
./hiawatha[0x804f6a7]
./hiawatha[0x804fc06]
./hiawatha[0x804fe61]
/lib/tls/i686/cmov/libpthread.so.0[0xb7d904fb]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7d12e5e]
======= Memory map: ========
Aborted
t_cached_object *add_to_cache(t_session *session, char *file) {
t_cached_object *object;
struct stat status;
off_t size;
int fd, i;
size_t bytes_read, bytes_total = 0;
fprintf(stderr, "OKE1\n");
if (stat(file, &status) == -1) {
fprintf(stderr, "OKE2\n");
return NULL;
} else if ((size = status.st_size) == -1) {
fprintf(stderr, "OKE3\n");
return NULL;
} else if ((size < session->config->cache_min_filesize) || (size > session->config->cache_max_filesize)) {
fprintf(stderr, "OKE4\n");
return NULL;
} else if (cachesize + size > session->config->cache_size) {
fprintf(stderr, "OKE5\n");
return NULL;
} else if ((object = (t_cached_object*)malloc(sizeof(t_cached_object))) == NULL) {
fprintf(stderr, "OKE6\n");
return NULL;
} else if ((object->file = strdup(file)) == NULL) {
fprintf(stderr, "OKE7\n");
free(object);
return NULL;
} else if ((object->data = (char*)malloc(size)) == NULL) {
fprintf(stderr, "OKE8\n");
free(object->file);
free(object);
return NULL;
}
fprintf(stderr, "OKE9\n");
if ((fd = open(file, O_RDONLY)) != -1) {
while (bytes_total < size) {
if ((bytes_read = read(fd, object->data + bytes_total, size - bytes_total)) == -1) {
if (errno != EINTR) {
free(object->data);
free(object->file);
free(object);
close(fd);
return NULL;
}
} else {
bytes_total += bytes_read;
}
}
close(fd);
} else {
free(object->data);
free(object->file);
free(object);
return NULL;
}
fprintf(stderr, "OKE10\n");
Press Ctrl-C to shutdown the Hiawatha webserver.
OKE1
*** glibc detected *** ./hiawatha: corrupted double-linked list: 0x0807b2a8 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7c72149]
/lib/tls/i686/cmov/libc.so.6[0xb7c73edd]
/lib/tls/i686/cmov/libc.so.6(__libc_malloc+0x8d)[0xb7c75cad]
./hiawatha[0x804ade9]
./hiawatha[0x805f6bf]
./hiawatha[0x804f857]
./hiawatha[0x804fc15]
./hiawatha[0x804fda1]
/lib/tls/i686/cmov/libpthread.so.0[0xb7d5c4fb]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7cdee5e]
======= Memory map: ========
Aborted
if (stat(file, &status) == -1) {
fprintf(stderr, "OKE2\n");
return NULL;
}
if ((size = status.st_size) == -1) {
fprintf(stderr, "OKE3\n");
return NULL;
...
if ((object->file = strdup(file)) == NULL) {
fprintf(stderr, "OKE11\n");
free(object);
return NULL;
}
fprintf(stderr, "OKE12\n");
if ((object->data = (char*)malloc(size)) == NULL) {
fprintf(stderr, "OKE13\n");
free(object->file);
free(object);
return NULL;
}
fprintf(stderr, "OKE14\n");
Press Ctrl-C to shutdown the Hiawatha webserver.
OKE0
OKE2
OKE4
OKE6
OKE8
OKE10
OKE12
*** glibc detected *** ./hiawatha: corrupted double-linked list: 0x0807bd70 ***
fprintf(stderr, "size:%ld\n", size);
CacheMinFilesize = 1
OKE12
size:1816
*** glibc detected *** ./hiawatha: corrupted double-linked list: 0x0807be98 ***
fprintf(stderr, "%s\n", file);
Press Ctrl-C to shutdown the Hiawatha webserver.
OKE12
size:1816
/home/devel/www/404.html
*** glibc detected *** ./hiawatha: corrupted double-linked list: 0x0807be98 ***
Press Ctrl-C to shutdown the Hiawatha webserver.
OKE12
size:280
/home/devel/www/404.html
OKE14
*** glibc detected *** hiawatha-6.16/hiawatha: munmap_chunk(): invalid pointer: 0x0807bea0 ***
*** glibc detected *** hiawatha-6.16/hiawatha: corrupted double-linked list: 0x0807be98 ***
Press Ctrl-C to shutdown the Hiawatha webserver.
*** glibc detected *** hiawatha-6.16/hiawatha: corrupted double-linked list: 0x0807be98 ***