# word alone directives:
# daemon
# strict
#nolock
noresolv
#nologs
# noargs
verbose 0

# Timeout
#notimeout
timeout 1000  # Request timeout
#exectimeout 1 # execve lifetime

whitespace _
env SCREWS_TEST
#env LUA_INIT
env LB_HOSTS http://news.nopcode.org/_http://www.google.com/
env INDEX index.c.html
env WWWROOT /home/sepharad/htdocs/
#env INDEX pop.jpg
#env WWWROOT /home/ftp/tmp/
#env WWWROOT /emul/linux/home/pancake/prg/screws/src/Exec/perl/htdocs/
#env WWWROOT /emul/linux/home/pancake/dcc/Lenore/
#env WWWROOT /home/pancake/
#env WWWROOT /tmp
#env MIMEFILE /usr/pkg/etc/sylpheed/mime.types
env MIMEFILE /home/sepharad/programacion/screws-0.56/src/Utils/mime.types

# HSML CACHE CONFIG
env HSML_TMP /tmp
# cacherule: never|noinput|time
env HSML_CACHERULE noinput
# cache: exec|output|both
env HSML_CACHE both
env HSML_LANG_MOD ../Hsml 

backlog 10
keep 10

# Best IOs: usage 'io [mode]'
#  - Linux: direct - select - poll - buffer
#  - BSD: direct - buffer - poll - select
io poll
io direct
#io buffer
#io select

#maxthr 8000
maxthr 10

# ssl3 and tls fails :/
enc ssl2 #ssl23 # ssl3 tls

#=== Set Defaults ===#
#maxhdr 1024          # Max Number of headers accepted from client
#maxhdr 99999
#maxhdr 3
usleep 100
# httplen 4096 # -1 is infinite
# LOGS
#logfile /tmp/access.log
#logfile |/tmp/how
logfile /tmp/access.log
errfile /tmp/error.log
whitespace _
logstr %I_-_[%d]_"%m_%f_HTTP/%H"_%e_-_"%h"_"%a"
#logstr Source-IP:%i-Date:-%d-Host:-%h---:)

# Listening ports and IPs
#-----------------------------------.
#      proto      ip         port   name
listen inet       0.0.0.0    9998 example
#listen inet       127.0.0.1  8001   localhost
#listen inet6      ::1        8002   inet6host

# Executions
chdir * ../Exec/perl/
exec  * ./main.pl

#chdir * ../Exec/sh/
#exec  * ./basic.sh
#exec ./main.pl
#chdir * ../Exec/c/
#exec  * ./linksys

# Administrative console
#console inet  127.0.0.1  88

# SSL support
#addssl [listen-id] [rsa-cert] {[privkey]}
#addssl anexample.org /tmp/newreq.pem /tmp/newreq.pem
#addssl localhost ../../../conf/newreq.pem  #/home/pancake/rsa_key
# The password for theses PEMs are "popa"

# Modules
#addmod ../Modules/BasicExec.so
addmod ../Modules/CleanLog.so
addmod ../Modules/Mime.so
#addmod ../Modules/MyReq.so
addmod ../Modules/unicode.so
#addmod ../Modules/noupdir.so
#addmod ../Modules/LoadBalancing.so
#addmod ../Modules/Hello.so # Do the Hello! :)
addmod ../Modules/HsmlExec.so
#modopt hello JWOJOWJWO-jeje-jiji
#addmod ../Modules/BasicExec.so # Do the Hello! :)

# Threads
#maxcpu * 10
##maxmem * 800192 # Alert on that! xDD
maxthr @* 1000
#maxthr localhost 1
#setuid @localhost 100

#prio 18
#prio localhost -20
#prio loca1host -20
#exectimeout * 1
#docore # debug exectimeout processes :) Kill with SEGV
#timeout localhost 5

# Load Balancing (not implemented)
# limits per IP

# Sons Environment
#whitespace \
env * HTDOCS wowow
#env * WWWROOT /tmp
#env * HOME /htdocs/
#env * BANNER SWebS\server.\nice\2do\:)

# Security issues 
#
# action name [ threadvalue ]
#chdir	/var/www/
#chroot   localhost     /home/www/
#chdir     *    htdocs/
#setuid @localhost 1001
#setuid    *    1000
#seteuid   *    1000
#setgid    *    1000
#setegid   *    1000

#setuid * pancake
#setuid @anexample.org root
#setuid @* pancake



