| MERECAT.CONF(5) | File Formats Manual | MERECAT.CONF(5) |
merecat.conf —
merecat httpd configuration file
When merecat starts up it looks for its
configuration file, /etc/merecat.conf. This manual
page documents the settings available, which allows for more advanced
setups. For simpler use-cases, however, you may not need a
merecat.conf since the server runs fine with only
command line parameters.
The syntax of the config file is UNIX style key =
value, separated by whitespace. The “#” character marks
the start of a comment to end of line. The \ character can be used as an
escape character.
Note: changes to the configuration file are
require a restart of merecat, unlike many other UNIX
daemons SIGHUP does not reload the
.conf file.
charset
= "STRING"check-referer
= <true |
false>check-symlinks
= <true |
false>chroot
= <true |
false>merecat.conf cannot access files outside it,
unless files are bind mounted, or similar into the chroot. Disabled by
default.compression-level
= -1..9The default setting, -1, means all "text/*" MIME type files, larger than 256 bytes, are compressed before sending to the client.
directory
= DIRdata-directory directive for more help.data-directory
= DIRdirectory
directive.global-passwd
= <true |
false>merecat.conf looks for a local
.htpasswd and .htaccess
file, or serves the file without password.hostname
= HOSTNAMElist-dotfiles
= <true |
false>local-pattern
= "PATTERN"check-referer, see
merecat(8) for more details.max-age
= SECport
= PORTssl section below for
more on configuring an HTTPS server.url-pattern
= "PATTERN"check-referer, see
merecat(8) for more details.username
= "NAME"virtual-host
= <true |
false>user-agent-deny
= "PATTERN"The default is disabled, i.e. all user-agents are allowed.
cgi
"PATTERN" {}php
"PATTERN" {*, it is very important otherwise any HTTP GET
request with arguments will fail.
enabled
= <true |
false>cgi-path
= "/path/to/php-cgi"}ssi
"PATTERN" {enabled
= <true |
false>cgi-path
= "/path/to/ssi"silent
= <true |
false>}ssl
{protocol
= "PROTOCOL"ciphers
= "CIPHERS"TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256: \ HIGH:!aNULL:!kRSA:!PSK:!SRP:!MD5:!RC4:!DHE-RSA-CAMELLIA256-SHA: \ !DHE-RSA-CAMELLIA128-SHA:!ECDHE-RSA-CHACHA20-POLY1305: \ !DHE-RSA-CHACHA20-POLY1305:!DHE-RSA-AES256-CCM8:!DHE-RSA-AES256-CCM: \ !DHE-RSA-AES128-CCM8:!DHE-RSA-AES128-CCM
certfile
= /path/to/cert.pemfullchain.pem if you use Let's
Encrypt. Only PEM format is supported.keyfile
= /path/to/key.pemprivkey.pem if you use Let's Encrypt. Only PEM
format is supported.
Note: This file must be kept private and should not be in the WEBROOT directory.
dhfile
= /path/th/dhparam.pemkeyfile the dhfile can
be published online, if necessary. Create one like this:
openssl dhparam -out dhparam.pem 2048
}server
name {port
= PORTssl
{ ...
}location
"PATTERN" {path
= path/to/rewriteredirect or virtual host. It is primarily
used to rewrite, or redirect, requests inside the current server
context.
E.g., for handling certbot
HTTP-01 renewal, use this in the port 80 server context. Any
other path will be redirected to HTTPS, using the below
redirect directive:
location "/.well-known/acme-challenge/**" {
path = "letsencrypt/.well-known/acme-challenge/"
}
redirect
"PATTERN" {code
= CODElocation
=
"proto://$host:port$request_uri$args"redirect "/**" {
code = 301
location = "https://$host$request_uri$args"
}
}}Jef Poskanzer
⟨jef@mail.acme.com⟩ wrote the famous
thttpd which merecat.conf is
based on.
Joachim Wiberg ⟨troglobit@gmail.com⟩
added the .conf file parser and this man page.
| November 28, 2021 | merecat (2.32) |