<xml2doc>
<info keywords="screws.conf" 
      title="screws configuration file"
      trapped="5"/>
<page>

<t size="20">NAME</t>
<t>screws.conf - Screws configuration file.</t>

<t size="20">DESCRIPTION</t>
<t>The \fBscrews.conf\fP file is the default configuration file for screws.
This file is composed by lines telling to the interpreter how to run the
server, which files to read, ports to listen, security issues, permissions,
environment variables, IO stuff, SSL parameters, logging facilities and
restrictions.
</t>
<t>
There's one optional argument passed to some directives named as '[?]', 
it's used to define where the directive will act. This argument could be
for example if you don't define this argument, the value will be defined
as global, and every thread created after it will inherit this value.

Also this argument could be a name of a thread, or '*' if you want to
apunter to all threads, or '@*' if you want to apunter to all threads
created by every listenthread (it means execution threads). Or just
type the name of the thread, for example: 'default' or '@default'.
</t>

<t size="20">
DIRECTIVES</t>
<t underline="true">Control directives</t>
<list title="daemon">Starts the server in background.</list>
<list title="strict">Be strict in warnings produced by the configuration file, missconfigurations, syntax errors, etc.</list>
<list title="verbose">Verbose level. This value comes from 0 to 5, it's used for debugging purposes, the default value is '0'.</list>
<list title="whitespace [char]">Specify the character that will be an alias for the ' ' character.</list>
<sep/>

<t underline="true">Screws directives</t>
<list title="listen [proto] [ip] [port] [name]">Where [proto] is 'inet' or 'inet6'. [ip] is the IP where screws will bind to it (for example 0.0.0.0), and [name] is the alias name for this listenThread.</list>
<list title="exec [?] [pathtobin]">This directive is used to specify the program or script that will get the connection, parse the arguments of the request and print the output.</list>
<list title="env [?] [var] ([value])">Using env you can set and unset environment variables to the threads. Environment variables are inherited from their parent processes. If value isn't defined. screws will unsetenv it.</list>

<t underline="true">Network directives</t>
<list title="io [type]">IO type means the internal functionality of buffers and streams. Nowadays there are 4 different methods: \fBdirect, buffer, poll, select\fP. Depending on your requeriments you would have to select one. Their differences are: \fBdirect\fP is just direct output, it means that there's no buffering and SSL is not supported, \fBbuffer\fP wraps the output by the tcp-window size and only supports output buffering, there's no input (PUT method will not work here). \fBpoll\fP and \fBselect\fP works on a similar way, but poll should work faster, and select is more portable than poll.</list>
<list title="httplen">Limits the number of characters in the input request. Default value is MAX_INT.</list>
<list title="timeout [?] [seconds]">Sets a timeout for the client connections.</list>
<list title="notimeout">This directive disables all connection timeouts.</list>
<list title="falsetimeout">When this directive is set, every line typed into the incomming connection will reset the alarm timeout.</list>
<list title="noresolv">It's used to disable all dns name lookups, it's useful to enhace timeouts.</list>
<list title="backlog [?] [number]">The maximum number of connections that will be handled in queue by the operating system.</list>
<list title="maxhdr [?] [number]">It's used to specify the maximum number of headers that the client will be able to write from the client.</list>
<list title="noargs">This directive disables all argument parsing. (?var=value&amp;var2=value2)</list>

<t underline="true">Logging directives</t>
<list title="logstr [?] [string]">Sets the logging string. By default is set to the standard apache format. Format have these variables: %a:useragent, %e:errorcode, %r:referer, %i:remoteIP, %I:remoteHOST, %h:host(vhosts), %H:httpversion, %d:date in human format, %t:hexdate, %f:file requested, %m method, %c:argc, %n:newline</list>
<list title="nologs">Disable logs.</list>
<list title="nolock">Disable file locking access. Just for debugging if you have problems with locked threads.</list>
<list title="logfile [?] [file]">Specifies the file where screws will write the access log.</list>
<list title="errfile [?] [file]">Sets the file where screws will write the error log.</list>

<t underline="true">Tunning directives</t>
<list title="maxthr [?] [number]">Defines the maximum number of threads that this process can have.</list>
<list title="maxcpu [?] [number]">Defines the time of life for the process.</list>
<list title="maxmem [?] [number]">Sets the maximum amount of memory that this process would handle.</list>
<list title="prio [?] [number]">Nice the process to this value.</list>
<list title="usleep [usecs]">Sets the usecs time that screws will sleep in infinite loops.(fine tunning)</list>

<t underline="true">Module directives</t>
<list title="addmod [module]">Loads a module into memory. Modules path is set by default to: ${PREFIX}/lib/screws/. You can give the complete URL or relative URL from your current directory or just the name of the module with or without the '.so' extension.</list>
<list title="modopt [module] [argument]">Sets an option for a module. These options are documented inside every module. Not all modules takes arguments.</list>


<t underline="true">Security directives</t>
<list title="setuid|seteuid [?] [usr]">Sets the UserID or EffectiveUserID to the given username/uid.</list>
<list title="setgid|setegid [?] [grp]">Sets the GroupID or EffectiveGroupID to the given groupname/gid.</list>
<list title="chroot [?] [dir]">Sets the directory where the thread will chroot to it. Parent process must be root or kernel permissions to execute this syscall. It's executed in a secure way, it means: "chdir(dir);chroot(.)". Like BSD systems do.</list>
<list title="chdir [?] [dir]">Sets the directory where the process will change to.</list>

<t underline="true">SSL directives</t>
<list title="enc [algorithm]">Algorithm can be set to ssl2, ssl3, tls and ssl23.</list>
<list title="addssl [?] [cert] ([private key])">Sets to the thread [?] the SSL comunication. You must specify the certificate and private key. On loading, screws will ask for the SSL password.</list>

<t size="20">EXAMPLE</t>
<t font="Courier">
#
# SCREWS default configuration file
#
noresolv
io buffer

listen inet 0.0.0.0 80 default

chdir @* perl/
exec * ./main.pl

addmod unicode
addmod Mime
addmod noupdir

setuid @* screws
</t>


<include src="foot.xml"/>
</page>
</xml2doc>
