2018-03-05 08:51:29 +00:00
|
|
|
.Dd 2018-03-05
|
2016-09-02 07:59:02 +00:00
|
|
|
.Dt QUARK 1
|
2018-03-05 08:51:29 +00:00
|
|
|
.Os suckless.org
|
2016-09-02 07:59:02 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm quark
|
2018-03-05 08:51:29 +00:00
|
|
|
.Nd simple static web server
|
2016-09-02 07:59:02 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2018-03-05 08:51:29 +00:00
|
|
|
.Fl h Ar host
|
|
|
|
.Fl p Ar port
|
|
|
|
.Op Fl u Ar user
|
|
|
|
.Op Fl g Ar group
|
|
|
|
.Op Fl n Ar num
|
2016-09-02 07:59:02 +00:00
|
|
|
.Op Fl d Ar dir
|
2018-03-05 08:51:29 +00:00
|
|
|
.Op Fl l
|
|
|
|
.Op Fl i Ar file
|
|
|
|
.Oo Fl v Ar vhost Oc ...
|
|
|
|
.Oo Fl m Ar map Oc ...
|
|
|
|
.Nm
|
|
|
|
.Fl U Ar file
|
|
|
|
.Op Fl p Ar port
|
2016-09-02 07:59:02 +00:00
|
|
|
.Op Fl u Ar user
|
|
|
|
.Op Fl g Ar group
|
2018-03-05 08:51:29 +00:00
|
|
|
.Op Fl n Ar num
|
|
|
|
.Op Fl d Ar dir
|
|
|
|
.Op Fl l
|
|
|
|
.Op Fl i Ar file
|
|
|
|
.Oo Fl v Ar vhost Oc ...
|
|
|
|
.Oo Fl m Ar map Oc ...
|
2016-09-02 07:59:02 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
2018-03-05 08:51:29 +00:00
|
|
|
is a simple HTTP GET/HEAD-only web server for static content.
|
2016-09-02 07:59:02 +00:00
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl d Ar dir
|
|
|
|
Serve
|
|
|
|
.Ar dir
|
|
|
|
after chrooting into it.
|
2018-03-05 08:51:29 +00:00
|
|
|
The default is ".".
|
2016-09-02 07:59:02 +00:00
|
|
|
.It Fl g Ar group
|
2018-03-05 08:51:29 +00:00
|
|
|
Set group ID when dropping privileges, and in socket mode the group of the
|
|
|
|
socket file, to the ID of
|
|
|
|
.Ar group .
|
|
|
|
The default is "nogroup".
|
2016-09-02 07:59:02 +00:00
|
|
|
.It Fl h Ar host
|
|
|
|
Use
|
|
|
|
.Ar host
|
|
|
|
as the server hostname.
|
2018-03-05 08:51:29 +00:00
|
|
|
.It Fl i Ar file
|
|
|
|
Set
|
|
|
|
.Ar file
|
|
|
|
as the directory index.
|
|
|
|
The default is "index.html".
|
|
|
|
.It Fl l
|
|
|
|
Enable directory listing.
|
|
|
|
.It Fl m Ar map
|
|
|
|
Add the target prefix mapping rule specified by
|
|
|
|
.Ar map ,
|
|
|
|
which has the form
|
|
|
|
.Qq Pa chost from to ,
|
|
|
|
where each element is separated with whitespace.
|
|
|
|
.Pp
|
|
|
|
The prefix
|
|
|
|
.Pa from
|
|
|
|
of all matching targets, especially only of those requests for the canonical
|
|
|
|
virtual host
|
|
|
|
.Pa chost
|
|
|
|
when virtual hosts are specified, is then replaced with
|
|
|
|
.Pa to .
|
|
|
|
If no virtual hosts are given,
|
|
|
|
.Pa chost
|
|
|
|
is ignored.
|
|
|
|
.It Fl n Ar num
|
|
|
|
Set the maximum number of threads to
|
|
|
|
.Ar num .
|
|
|
|
The default is 512.
|
2016-09-02 07:59:02 +00:00
|
|
|
.It Fl p Ar port
|
2018-03-05 08:51:29 +00:00
|
|
|
In host mode, listen on port
|
2016-09-02 07:59:02 +00:00
|
|
|
.Ar port
|
|
|
|
for incoming connections.
|
2018-03-05 08:51:29 +00:00
|
|
|
In socket mode, use
|
|
|
|
.Ar port
|
|
|
|
for constructing proper virtual host
|
|
|
|
redirects on non-standard ports.
|
|
|
|
.It Fl U Ar file
|
|
|
|
Create the UNIX-domain socket
|
|
|
|
.Ar file ,
|
2018-02-05 16:15:05 +00:00
|
|
|
listen on it for incoming connections and remove it on exit.
|
2018-03-05 08:51:29 +00:00
|
|
|
.It Fl u Ar user
|
|
|
|
Set user ID when dropping privileges,
|
|
|
|
and in socket mode the user of the socket file,
|
|
|
|
to the ID of
|
|
|
|
.Ar user .
|
|
|
|
The default is "nobody".
|
|
|
|
.It Fl v Ar vhost
|
|
|
|
Add the virtual host specified by
|
|
|
|
.Ar vhost ,
|
|
|
|
which has the form
|
|
|
|
.Qq Pa chost regex dir prefix ,
|
|
|
|
where each element is separated with whitespace.
|
|
|
|
.Pp
|
|
|
|
A request matching the virtual host regular expression
|
|
|
|
.Pa regex
|
|
|
|
(see
|
|
|
|
.Xr regex 3)
|
|
|
|
is redirected to the canonical host
|
|
|
|
.Pa chost ,
|
|
|
|
if they differ, using the directory
|
|
|
|
.Pa dir
|
|
|
|
as the root directory, optionally prefixing the target with
|
|
|
|
.Pa prefix .
|
|
|
|
If any virtual hosts are specified, all requests on non-matching
|
|
|
|
hosts are discarded.
|
2016-09-02 07:59:02 +00:00
|
|
|
.El
|
|
|
|
.Sh CUSTOMIZATION
|
|
|
|
.Nm
|
|
|
|
can be customized by creating a custom config.h from config.def.h and
|
|
|
|
(re)compiling the source code. This keeps it fast, secure and simple.
|
2018-03-05 08:51:29 +00:00
|
|
|
.Sh AUTHORS
|
|
|
|
.An Laslo Hunhold Aq Mt dev@frign.de
|