12 Serve /var/www/htdocs on the default port (port 80):
13 $ ./darkhttpd /var/www/htdocs
15 Serve ~/public_html on port 8081:
16 $ ./darkhttpd ~/public_html --port 8081
18 Only bind to one IP address (useful on multi-homed systems):
19 $ ./darkhttpd ~/public_html --addr 192.168.0.1
21 Serve at most 4 simultaneous connections:
22 $ ./darkhttpd ~/public_html --maxconn 4
24 Log accesses to a file:
25 $ ./darkhttpd ~/public_html --log access.log
27 Chroot for extra security (you need root privs for chroot):
28 $ ./darkhttpd /var/www/htdocs --chroot
30 Use default.htm instead of index.html:
31 $ ./darkhttpd /var/www/htdocs --index default.htm
33 Add mimetypes - in this case, serve .dat files as text/plain:
36 $ ./darkhttpd /var/www/htdocs --mimetypes extramime
39 $ ./darkhttpd /var/www/htdocs --uid www --gid www
41 Use acceptfilter (FreeBSD only):
43 $ ./darkhttpd /var/www/htdocs --accf
45 Run in the background and create a pidfile:
46 $ ./darkhttpd /var/www/htdocs --pidfile /var/run/httpd.pid --daemon
48 Commandline options can be combined:
49 $ ./darkhttpd ~/public_html --port 8080 --addr 127.0.0.1
51 To see a full list of commandline options,
52 run darkhttpd without any arguments: