mongoose.1 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. .\" Process this file with
  2. .\" groff -man -Tascii mongoose.1
  3. .\" $Id: mongoose.1,v 1.12 2008/11/29 15:32:42 drozd Exp $
  4. .Dd Aug 31, 2010
  5. .Dt mongoose 1
  6. .Sh NAME
  7. .Nm mongoose
  8. .Nd lightweight web server
  9. .Sh SYNOPSIS
  10. .Nm
  11. .Op Ar config_file
  12. .Nm
  13. .Op Ar OPTIONS
  14. .Nm
  15. .Fl A Ar htpasswd_file domain_name user_name password
  16. .Sh DESCRIPTION
  17. .Nm
  18. is small, fast and easy to use web server with CGI, SSL, MD5 authorization,
  19. and basic SSI support.
  20. .Pp
  21. .Nm
  22. does not detach from terminal, and uses current working directory
  23. as the web root, unless
  24. .Fl r
  25. option is specified.
  26. It is possible to specify multiple ports to listen on. For example, to make
  27. mongoose listen on HTTP port 80 and HTTPS port 443, one should start it as:
  28. .Nm
  29. .Fl s Ar cert.pem Fl p Ar 80,443s
  30. .Pp
  31. Unlike other web servers,
  32. .Nm
  33. does not expect CGI scripts to be put in a special directory. CGI scripts can
  34. be anywhere. CGI (and SSI) files are recognized by the file extension.
  35. .Pp
  36. If no arguments are given,
  37. .Nm
  38. searches for a configuration file called "mongoose.conf" in the same directory
  39. where mongoose binary is located. Alternatively, a file name could be
  40. specified in the command line. Format of the configuration file is the same
  41. as for the command line options except that each option must be specified
  42. on a separate line, leading dashes for option names must be omitted.
  43. Lines beginning with '#' and empty lines are ignored.
  44. .Pp
  45. .Sh OPTIONS
  46. .Bl -tag -width indent
  47. .It Fl A Ar htpasswd_file domain_name user_name password
  48. Add/edit user's password in the passwords file. Deleting users can be done
  49. with any text editor. Functionality is similar to Apache's
  50. .Ic htdigest
  51. utility.
  52. .It Fl C Ar cgi_extensions
  53. Comma-separated list of CGI extensions. All files having these extensions
  54. are treated as CGI scripts. Default: ".cgi,.pl,.php"
  55. .It Fl E Ar cgi_environment
  56. Extra environment variables to be passed to the CGI script in addition to
  57. standard ones. The list must be comma-separated list of X=Y pairs, like this:
  58. "VARIABLE1=VALUE1,VARIABLE2=VALUE2". Default: ""
  59. .It Fl G Ar put_delete_passwords_file
  60. PUT and DELETE passwords file. This must be specified if PUT or
  61. DELETE methods are used. Default: ""
  62. .It Fl I Ar cgi_interpreter
  63. Use
  64. .Ar cgi_interpreter
  65. as a CGI interpreter for all CGI scripts regardless script extension.
  66. Default: "". Mongoose decides which interpreter to use by looking at
  67. the first line of a CGI script.
  68. .It Fl M Ar max_request_size
  69. Maximum HTTP request size in bytes. Default: "16384"
  70. .It Fl P Ar protect_uri
  71. Comma separated list of URI=PATH pairs, specifying that given URIs
  72. must be protected with respected password files. Default: ""
  73. .It Fl R Ar authentication_domain
  74. Authorization realm. Default: "mydomain.com"
  75. .It Fl S Ar ssi_extensions
  76. Comma separated list of SSI extensions. Unknown SSI directives are silently
  77. ignored. Currently, two SSI directives supported, "include" and "exec".
  78. Default: "shtml,shtm"
  79. .It Fl a Ar access_log_file
  80. Access log file. Default: "", no logging is done.
  81. .It Fl d Ar enable_directory_listing
  82. Enable/disable directory listing. Default: "yes"
  83. .It Fl e Ar error_log_file
  84. Error log file. Default: "", no errors are logged.
  85. .It Fl g Ar global_passwords_file
  86. Location of a global passwords file. If set, per-directory .htpasswd files are
  87. ignored, and all requests must be authorised against that file. Default: ""
  88. .It Fl i Ar index_files
  89. Comma-separated list of files to be treated as directory index files.
  90. Default: "index.html,index.htm,index.cgi"
  91. .It Fl l Ar access_control_list
  92. Specify access control list (ACL). ACL is a comma separated list
  93. of IP subnets, each subnet is prepended by '-' or '+' sign. Plus means allow,
  94. minus means deny. If subnet mask is
  95. omitted, like "-1.2.3.4", then it means single IP address. Mask may vary
  96. from 0 to 32 inclusive. On each request, full list is traversed, and
  97. last match wins. Default setting is to allow all. For example, to allow only
  98. 192.168/16 subnet to connect, run "mongoose -0.0.0.0/0,+192.168/16".
  99. Default: ""
  100. .It Fl m Ar extra_mime_types
  101. Extra mime types to recognize, in form
  102. "extension1=type1,extension2=type2,...". Extension must include dot.
  103. Example: "mongoose -m .cpp=plain/text,.java=plain/text". Default: ""
  104. .It Fl p Ar listening_ports
  105. Comma-separated list of ports to listen on. If the port is SSL, a letter 's'
  106. must be appeneded, for example, "-p 80,443s" will open port 80 and port 443,
  107. and connections on port 443 will be SSL-ed. It is possible to specify an
  108. IP address to bind to. In this case, an IP address and a colon must be
  109. prepended to the port number. For example, to bind to a loopback interface
  110. on port 80 and to all interfaces on HTTPS port 443, use
  111. "mongoose -p 127.0.0.1:80,443s". Default: "8080"
  112. .It Fl r Ar document_root
  113. Location of the WWW root directory. A comma separated list of
  114. URI_PREFIX=DIRECTORY
  115. pairs could be appended to it, allowing Mongoose to serve from multiple
  116. directories. For example, "mongoose -p /var/www,/config=/etc,/garbage=/tmp".
  117. Default: "."
  118. .It Fl s Ar ssl_certificate
  119. Location of SSL certificate file. Default: ""
  120. .It Fl t Ar num_threads
  121. Number of worker threads to start. Default: "10"
  122. .It Fl u Ar run_as_user
  123. Switch to given user's credentials after startup. Default: ""
  124. .El
  125. .Pp
  126. .Sh EMBEDDING
  127. .Nm
  128. was designed to be embeddable into C/C++ applications. Since the
  129. source code is contained in single C file, it is fairly easy to embed it
  130. and follow the updates. Please refer to http://code.google.com/p/mongoose
  131. for details.
  132. .Pp
  133. .Sh EXAMPLES
  134. .Bl -tag -width indent
  135. .It Nm Fl r Ar /var/www,/aa=/tmp,/bb=/etc Fl s Ar /etc/cert.pem Fl p Ar 8080,8043s
  136. Start listening on port 8080 for HTTP, and 8043 for HTTPS connections.
  137. Use /etc/cert.pem as SSL certificate file. Web root is /var/www. In addition,
  138. map directory /tmp to URI /aa, directory /etc to URI /bb.
  139. .It Nm Fl l Ar -0.0.0.0/0,+10.0.0.0/8,+1.2.3.4
  140. Deny connections from everywhere, allow only IP address 1.2.3.4 and
  141. all IP addresses from 10.0.0.0/8 subnet to connect.
  142. .El
  143. .Pp
  144. .Sh COPYRIGHT
  145. .Nm
  146. is licensed under the terms of the MIT license.
  147. .Sh AUTHOR
  148. .An Sergey Lyubka Aq valenok@gmail.com .