.PU
.TH FILED 1 "22 Sep 2016" "filed 1.21"
.SH NAME
filed \- serve files over HTTP
.SH SYNOPSIS
.ll +10
.B filed
.RB [{ \-h | \-\-help }]
.RB [{ \-d | \-\-daemon }]
.RB [{ \-v | \-\-version }]
.RB [{ \-V | \-\-vhost }]
.RB [{ \-b | \-\-bind }
.IR address ]
.RB [{ \-p | \-\-port }
.IR port ]
.RB [{ \-t | \-\-threads }
.IR count ]
.RB [{ \-c | \-\-cache }
.IR entries ]
.RB [{ \-l | \-\-log }
.IR file ]
.RB [{ \-u | \-\-user }
.IR user ]
.RB [{ \-r | \-\-root }
.IR directory ]
.ll -10
.SH DESCRIPTION
.I FILED
serves files over HTTP as minimally as possible. Only static files (i.e., files that never change or are replaced) are supported.
.SH OPTIONS
.TP
.B -h (or --help)
Prints detailed usage information.
.TP
.B -d (or --daemon)
Instructs
.B filed
to become a daemon after initializing
the listening TCP socket and log files.
.TP
.B -v (or --version)
Instructs
.B filed
to print out its version number and then exit.
.TP
.B -V (or --vhost)
instructs filed to prepend all requests with their HTTP
Host header.
.TP
.B -b (or --bind)
Specifies the address to listen for incoming HTTP
requests on.
.TP
.B -p (or --port)
Specifies the TCP port number to listen for incoming HTTP
requests on.
.TP
.B -t (or --threads)
Specifies the number of worker threads to create. Each
worker thread can service one concurrent HTTP session.
Thus the number of threads created will determine how
many simultaneous transfers will be possible.
.TP
.B -c (or --cache)
Specifies the number of file information cache entries
to allocate. Each cache entry holds file information as
well as an open file descriptor to the file, so resource
limits (i.e., ulimit) should be considered. This should
be a prime number for ideal use with the lookup method.
.TP
.B -l (or --log)
Specifies a filename to open for writing log entries. Log
entries are made for various stages in transfering files.
The log file is opened before switching users (see "-u")
and root directories (see "-r"). The log file is never
closed so log rotation without stopping the daemon is will
not work. The value of "-" indicates that standard output
should be used for logging. If the filename begins with a
pipe ("|") then a process is started and used for logging
instead of a file.
.TP
.B -u (or --user)
Specifies the user to switch user IDs to before servicing
requests. The default is not change user IDs.
.TP
.B -r (or --root)
Specifies the directory to act as the root directory for
the file server. If this option is specified, chroot(2)
is called. The default is not change root directories,
that is, the "/" directory is shared out. This will
likely be a security issue, so this option should always
be used.
.SH AUTHOR
.Sp
Roy Keene
.I <filed@rkeene.org>