SHTTPD(1) FreeBSD General Commands Manual SHTTPD(1) NAME shttpd -- lightweight web server SYNOPSIS shttpd [OPTIONS] [config_file] shttpd -A htpasswd_file realm username password DESCRIPTION shttpd is small, fast and easy to use web server with CGI, SSL, Digest Authorization support. It can be run as stand-alone server, be managed by inetd(8) , or be embedded into existing C/C++ application. Unlike other web servers, shttpd does not expect CGI scirpts to be put in a special directory. They may be anywhere. CGI files are recognized by an extension, which is ``.cgi'' by default. By default shttpd does not use SSL and starts listening on port 80. Spec- ifying the -s pem_file option automatically switches shttpd to SSL mode on port 443. shttpd can take configuration parameters from two sources: from the com- mand line and from the configuration file. Command line parameters have higher priority. Every command line parameter has associated configura- tion file keyword, except -A parameter. In the configuration file, blank lines and lines started with ``#'' character are ignored. All other lines must start with the keyword followed by a whitespace followed by key- word's value. If both command line parameter and configuration file option are not specified, the default value is taken. The configuration file may not be present at all. If shttpd should be managed by inetd(8), add this line to inetd.conf: http stream tcp nowait nobody /path/to/shttpd shttpd -I1 -d /my/www OPTIONS Below is the list of command line parameters. In the brackets there are corresponding configuration file keywords. -A htpasswd server_name user_name user_password Edit the passwords file. Functionality similar to Apache's htdigest utility. -C file (cgi_interpreter file) Force file to be a CGI interpreter for all CGI scripts. Default: none. -D 0|1 (list_directories 0|1) Disable directory listing. Default: enabled. -I 0|1 (inetd_mode 0|1) Enable inetd mode. Default: disabled. -N realm (server_name realm) Authorization realm. Default: ``mydomain.com''. -P file (global_htpasswd file) Location of global passwords file. Per-directory .htpasswd files are ignored, if this option is set. Default: not set. -U file (put_auth file) PUT and DELETE passwords file. This must be specified if PUT or DELETE methods are used. Default: none. -V string (cgi_envvar string) Pass additional environment variables to the CGI script. These must be comma-separated list of var=val pairs, like this: "VAR1=VAL1,VAR2=VAL2". Default: not set. -a string (aliases string) Attach directories (even those outside document_root) to URIs. The string must be comma-separated list of var=val pairs, like this: "/etc/=/my_etc,/tmp=/my_tmp". Default: not set. -c string (cgi_extension string) CGI filename pattern. For every requested file, shttpd uses the pattern to figure out whether to return the file content, ot run the file as CGI application. Default: ``.cgi''. -d directory (document_root directory) Location of the WWW root directory. Default: working directory from which shttpd has been started. -e file (error_log file) Error log file. Default: not set, no errors are logged. -l file (access_log file) Access log file. Default: not set, no logging is done. -m file (mime_types file) Location of mime types file. Default: not set, builtins are used. -p port (listen_port port) Listening port. Default: 80 for non-SSL and 443 for SSL mode. -s pem_file (ssl_certificate pem_file) Location of SSL certificate file. Default: not set. -u login (runtime_uid login) Switch to given user ID after startup. Default: not set EMBEDDING shttpd can be built as a library to embed web server functionality into C/C++ application. The API functions are declared in a header file shttpd.h. Please refer to the source package for a header file and the examples. FILES /usr/local/etc/shttpd.conf SEE ALSO inetd(8). COPYRIGHT shttpd is licensed under the terms of beerware license. AUTHOR Sergey Lyubka . Nov 10, 2006