mongoose.1 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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 P Ar protect_uri
  69. Comma separated list of URI=PATH pairs, specifying that given URIs
  70. must be protected with respected password files. Default: ""
  71. .It Fl R Ar authentication_domain
  72. Authorization realm. Default: "mydomain.com"
  73. .It Fl S Ar ssi_extensions
  74. Comma separated list of SSI extensions. Unknown SSI directives are silently
  75. ignored. Currently, two SSI directives supported, "include" and "exec".
  76. Default: "shtml,shtm"
  77. .It Fl a Ar access_log_file
  78. Access log file. Default: "", no logging is done.
  79. .It Fl d Ar enable_directory_listing
  80. Enable/disable directory listing. Default: "yes"
  81. .It Fl e Ar error_log_file
  82. Error log file. Default: "", no errors are logged.
  83. .It Fl g Ar global_passwords_file
  84. Location of a global passwords file. If set, per-directory .htpasswd files are
  85. ignored, and all requests must be authorised against that file. Default: ""
  86. .It Fl i Ar index_files
  87. Comma-separated list of files to be treated as directory index files.
  88. Default: "index.html,index.htm,index.cgi"
  89. .It Fl l Ar access_control_list
  90. Specify access control list (ACL). ACL is a comma separated list
  91. of IP subnets, each subnet is prepended by '-' or '+' sign. Plus means allow,
  92. minus means deny. If subnet mask is
  93. omitted, like "-1.2.3.4", then it means single IP address. Mask may vary
  94. from 0 to 32 inclusive. On each request, full list is traversed, and
  95. last match wins. Default setting is to allow all. For example, to allow only
  96. 192.168/16 subnet to connect, run "mongoose -0.0.0.0/0,+192.168/16".
  97. Default: ""
  98. .It Fl m Ar extra_mime_types
  99. Extra mime types to recognize, in form
  100. "extension1=type1,extension2=type2,...". Extension must include dot.
  101. Example: "mongoose -m .cpp=plain/text,.java=plain/text". Default: ""
  102. .It Fl p Ar listening_ports
  103. Comma-separated list of ports to listen on. If the port is SSL, a letter 's'
  104. must be appeneded, for example, "-p 80,443s" will open port 80 and port 443,
  105. and connections on port 443 will be SSL-ed. It is possible to specify an
  106. IP address to bind to. In this case, an IP address and a colon must be
  107. prepended to the port number. For example, to bind to a loopback interface
  108. on port 80 and to all interfaces on HTTPS port 443, use
  109. "mongoose -p 127.0.0.1:80,443s". Default: "8080"
  110. .It Fl r Ar document_root
  111. Location of the WWW root directory. A comma separated list of
  112. URI_PREFIX=DIRECTORY
  113. pairs could be appended to it, allowing Mongoose to serve from multiple
  114. directories. For example, "mongoose -p /var/www,/config=/etc,/garbage=/tmp".
  115. Default: "."
  116. .It Fl s Ar ssl_certificate
  117. Location of SSL certificate file. Default: ""
  118. .It Fl t Ar num_threads
  119. Number of worker threads to start. Default: "10"
  120. .It Fl u Ar run_as_user
  121. Switch to given user's credentials after startup. Default: ""
  122. .El
  123. .Pp
  124. .Sh EMBEDDING
  125. .Nm
  126. was designed to be embeddable into C/C++ applications. Since the
  127. source code is contained in single C file, it is fairly easy to embed it
  128. and follow the updates. Please refer to http://code.google.com/p/mongoose
  129. for details.
  130. .Pp
  131. .Sh EXAMPLES
  132. .Bl -tag -width indent
  133. .It Nm Fl r Ar /var/www,/aa=/tmp,/bb=/etc Fl s Ar /etc/cert.pem Fl p Ar 8080,8043s
  134. Start listening on port 8080 for HTTP, and 8043 for HTTPS connections.
  135. Use /etc/cert.pem as SSL certificate file. Web root is /var/www. In addition,
  136. map directory /tmp to URI /aa, directory /etc to URI /bb.
  137. .It Nm Fl l Ar -0.0.0.0/0,+10.0.0.0/8,+1.2.3.4
  138. Deny connections from everywhere, allow only IP address 1.2.3.4 and
  139. all IP addresses from 10.0.0.0/8 subnet to connect.
  140. .El
  141. .Pp
  142. .Sh COPYRIGHT
  143. .Nm
  144. is licensed under the terms of the MIT license.
  145. .Sh AUTHOR
  146. .An Sergey Lyubka Aq valenok@gmail.com .