.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "micro-httpd 8" .TH micro-httpd 8 "2016-07-02" "micro-httpd" "User Commands" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" micro\-httpd \- really small HTTP server .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& micro\-httpd DIRECTORY .Ve .SH "OPTIONS" .IX Header "OPTIONS" None. .SH "DESCRIPTION" .IX Header "DESCRIPTION" micro-httpd is a very small \s-1HTTP\s0 server all in 150 lines of code. It runs from inetd, which means its performance is poor. But for low-traffic sites, it is quite adequate. It implements all the basic features of an \s-1HTTP\s0 server, including: .PP .Vb 5 \& * Security against ".." filename snooping. \& * The common MIME types. \& * Trailing\-slash redirection. \& * index.html \& * Directory listings. .Ve .PP To install it, add a line like this to /etc/inetd.conf: .PP .Vb 2 \& micro\-http stream tcp nowait nobody \e \& /usr/sbin/micro\-httpd micro\-httpd dir .Ve .PP Make sure the path to the executable is correct, and change \*(L"dir\*(R" to be the directory you want to serve. You could add line like this to /etc/services: .PP .Vb 1 \& micro\-http port/tcp #Micro HTTP server .Ve .PP Change \*(L"port\*(R" to the port number you want to use: 80, 8000, whatever. Restart inetd by sending it a \*(L"\s-1HUP\*(R"\s0 signal. .PP On some systems, inetd has a maximum spawn rate \- if you try to run inetd services faster than a certain number of times per minute, it assumed there is either a bug of an attack going on and it shuts down for a few minutes. If you run into this problem \- look for syslog messages about too-rapid looping \- you will need to find out how to increase the limit. Unfortunately this varies from \s-1OS\s0 to \s-1OS.\s0 On FreeBSD, you add a \*(L"\-R 10000\*(R" flag to inetd's initial command line. On some Linux systems, you can set the limit on a per-service basis in inetd.conf, by changing \*(L"nowait\*(R" to \*(L"nowait.10000\*(R". .PP Note that you can use micro-httpd to serve \s-1HTTPS,\s0 if you like, by running it from stunnel. First fetch and install stunnel \- FreeBSD users can just go to /usr/ports/security/stunnel and do a \*(L"make cert ; make install\*(R". Then as root run: .PP .Vb 2 \& stunnel \-p /usr/local/certs/stunnel.pem \-d 443 \-l \e \& /usr/sbin/micro\-httpd \-\- micro\-httpd dir .Ve .PP Make sure the paths to the certificate and executable are correct, and again don not forget to change \*(L"dir\*(R" to the directory you want to serve. .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" None. .SH "FILES" .IX Header "FILES" None. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIinetd\fR\|(8) \&\fImicro\-inetd\fR\|(8) \&\fIxinetd\fR\|(8) .SH "AUTHORS" .IX Header "AUTHORS" Copyright (C) 1999 Jef Poskanzer . All rights reserved. .PP This manual page was updated by Jari Aalto . Released under license \s-1GNU GPL\s0 v2 or (at your option) any later version. For more information about license, visit .