SCREWS.CONF(5)

NAME
screws.conf - Screws configuration file

DESCRIPTION
The screws.conf 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.

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'.

DIRECTIVES

  Control directives

daemon
    Starts the server in background.

strict
    Be strict in warnings produced by the configuration file, missconfigurations, syntax errors, etc.

verbose
    Verbose level. This value comes from 0 to 5, it's used for debugging purposes, the default value is '0'.

whitespace [char]
    Specify the character that will be an alias for the ' ' character.

  Screws directives

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.

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.

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.

  Network directives

io [type]
    IO type means the internal functionality of buffers and streams. Nowadays there are 4 different methods: direct, buffer, poll, select. Depending on your requeriments you would have to select one. Their differences are: direct is just direct output, it means that there's no buffering and SSL is not supported, buffer wraps the output by the tcp-window size and only supports output buffering, there's no input (PUT method will not work here). poll and select works on a similar way, but poll should work faster, and select is more portable than poll.

httplen
    Limits the number of characters in the input request. Default value is MAX_INT.

timeout [?] [seconds]
    Sets a timeout for the client connections.

notimeout
    This directive disables all connection timeouts.

falsetimeout
    When this directive is set, every line typed into the incomming connection will reset the alarm timeout.

noresolv
    It's used to disable all dns name lookups, it's useful to enhace timeouts.

backlog [?] [number]
    The maximum number of connections that will be handled in queue by the operating system.

maxhdr [?] [number]
    It's used to specify the maximum number of headers that the client will be able to write from the client.

noargs
    This directive disables all argument parsing. (?var=value&var2=value2)

  Logging directives

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

nologs
    Disable logs.

nolock
    Disable file locking access. Just for debugging if you have problems with locked threads.

logfile [?] [file]
    Specifies the file where screws will write the access log.

errfile [?] [file]
    Sets the file where screws will write the error log.

  Tunning directives

maxthr [?] [number]
    Defines the maximum number of threads that this process can have.

maxcpu [?] [number]
    Defines the time of life for the process.

maxmem [?] [number]
    Sets the maximum amount of memory that this process would handle.

prio [?] [number]
    Nice the process to this value.

usleep [usecs]
    Sets the usecs time that screws will sleep in infinite loops.(fine tunning)

  Module directives

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.

modopt [module] [argument]
    Sets an option for a module. These options are documented inside every module. Not all modules takes arguments.

  Security directives

setuid|seteuid [?] [usr]
    Sets the UserID or EffectiveUserID to the given username/uid.

setgid|setegid [?] [grp]
    Sets the GroupID or EffectiveGroupID to the given groupname/gid.

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.

chdir [?] [dir]
    Sets the directory where the process will change to.

  SSL directives

enc [algorithm]
    Algorithm can be set to ssl2, ssl3, tls and ssl23.

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.

EXAMPLE

    #
    # 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

SEE ALSO
screwsctl(1), screwsd(8), screws.conf(5),

AUTHORS
Main developer: pancake <pancake@phreaker.net>