GMID(1) | General Commands Manual | GMID(1) |
gmid
— simple and
secure Gemini server
gmid |
[-fnv ]
[-c config]
[-D macro=value]
[-P pidfile] |
gmid |
[-6hVv ]
[-d certs-dir]
[-H hostname]
[-p port]
[-x cgi]
[dir] |
gmid
is a simple and minimal gemini server
that can serve static files, execute CGI scripts and talk to FastCGI
applications. It can run without a configuration file with a limited set of
features available.
gmid
rereads the configuration file when
it receives SIGHUP
.
The options are as follows:
-c
config-D
macro=value-f
-n
-P
pidfilegmid
will refuse to start.If no configuration file is given, gmid
runs in “config-less mode” (i.e. runs in the foreground to
serve a directory from the shell) and looks for the following options
-6
-d
certs-path-H
hostname-d
option. They have the form
hostname.cert.pem and
hostname.key.pem. If a certificate or a key
doesn't exist for a given hostname, they will be generated
automatically.-h
,
--help
-p
port-V
,
--version
-v
-v
options increase the
verbosity.-x
pathcgi
option in the
‘Servers’ section below to learn how
path is processed. Cannot be provided more than
once.Messages and requests are logged by syslog(3)
using the DAEMON
facility or printed on
stderr.
Requests are logged with the NOTICE
severity. Each request log entry has the following fields, separated by
whitespace:
Serve the current directory
$ gmid .
To serve the directory docs and enable CGI scripts inside docs/cgi
$ mkdir docs/cgi $ cat <<EOF > docs/cgi/hello #!/bin/sh printf "20 text/plain\r\n" echo "hello world" EOF $ chmod +x docs/cgi/hello $ gmid -x '/cgi/*' docs
To run gmid
as a deamon a configuration
file and a X.509 certificate must be provided. A self-signed certificate,
which are commonly used in the Geminispace, can be generated using for e.g.
openssl(1):
# openssl req -x509 -newkey rsa:4096 -nodes \ -keyout /etc/ssl/private/example.com.key \ -out /etc/ssl/example.com.pem \ -days 365 -subj "/CN=example.com" # chmod 600 /etc/ssl/example.com.crt # chmod 600 /etc/ssl/private/example.com.key
Then gmid
can be started with
# gmid -c /etc/gmid.conf
gmid
uses the “Flexible and
Economical” UTF-8 decoder written by Bjoern
Hoehrmann.
The gmid
program was written by
Omar Polo
<op@omarpolo.com>.
gmid
won't be able to serve files inside that directory until a restart. This
restriction only applies to the root directories and not their
content.April 7, 2022 | OpenBSD 7.1 |