forked from cppsp/cppspx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
socketd_exampleconf
executable file
·36 lines (34 loc) · 1.11 KB
/
socketd_exampleconf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
P="$(pwd)"
cat <<EOF1
listen 0.0.0.0:16969 512; //backlog=512
//default thread count is NCPU
//threads 2;
//bindings sections embedded in vhost sections are processed
//before bindings in the global scope
ipcbuffersize 16777216;
vhost vh1 {
bindings {
{
listen 0.0.0.0:16969;
httphost localhost:16969; //only match requests going to hostname "localhost"
}
}
//the second exec is a shell command telling the shell to not fork, but execve() directly
exec exec $P/socketd_cppsp -m /dir_list.cppsm -r $P/www -c -fPIC -c -L$P -c -I$P/include -c -Ofast -c -march=native -c -lcpoll -c -lcppsp;
shell 1;
preload 0; //socketd_cppsp is a native socketd application; no need to preload socketd_proxy
//at runtime, the # of processes will be rounded up to the nearest multiple
//of the # of socketd threads, so the actual processes started will be NCPU
processes 1;
}
vhost vh2 {
bindings {
//adjust your /etc/hosts to test this
{httphost host1:16969;}
}
exec exec lighttpd -D -f /path/to/lighttpd.conf;
shell 1;
preload 1; //preload socketd_proxy.so to run an unmodified http server under socketd
}
EOF1