Lines Matching +full:8 +full:- +full:linux +full:- +full:default +full:- +full:release
5 It may be embedded into C/C++ host applications or used as a stand-alone
9 The stand-alone server is self-contained, and does not require any external
11 [Visual C++ Redistributable](http://www.microsoft.com/en-us/download/details.aspx?id=30679).
15 ----
17 On Windows, UNIX and Mac, the CivetWeb stand-alone executable may be started
24 Pressing `Ctrl-C` keys will stop the server.
27 Right-clicking on the icon pops up a menu, where it is possible to stop
33 to this folder, double-click the exe, and launch a browser at
54 All command line arguments must start with `-`.
57 `CivetWeb -document_root D:\web`. Then the `D:\web` directory will be served
62 Note that configuration options on the command line must start with `-`,
67 $ CivetWeb -listening_ports 1234 -document_root /var/www
77 CivetWeb -A <htpasswd_file> <realm> <user> <passwd>
81 ----
84 Every option is followed by it's default value. If a default value is not
85 present, then the default is empty.
89 CivetWeb uses shell-like glob patterns for several configuration options,
110 the stand-alone executable as well as for applications embedding CivetWeb.
111 The stand-alone executable supports some additional options: see *Options from `main.c`*.
112 The options are explained in alphabetic order - for a quick start, check
116 Access-Control-Allow-Headers header field, used for cross-origin resource
117 sharing (CORS) pre-flight requests.
118 See the [Wikipedia page on CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing).
120 If set to an empty string, pre-flights will not allow additional headers.
121 If set to "*", the pre-flight will allow whatever headers have been requested.
122 If set to a comma separated list of valid HTTP headers, the pre-flight will return
127 Access-Control-Allow-Methods header field, used for cross-origin resource
128 sharing (CORS) pre-flight requests.
129 See the [Wikipedia page on CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing).
131 If set to an empty string, pre-flights will not be supported directly by the server,
132 but scripts may still support pre-flights by handling the OPTIONS method properly.
133 If set to "*", the pre-flight will allow whatever method has been requested.
134 If set to a comma separated list of valid HTTP methods, the pre-flight will return
139 Access-Control-Allow-Origin header field, used for cross-origin resource
141 See the [Wikipedia page on CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing).
147 subnet is pre-pended by either a `-` or a `+` sign. A plus sign means allow,
148 where a minus sign means deny. If a subnet mask is omitted, such as `-1.2.3.4`,
151 Subnet masks may vary from 0 to 32, inclusive. The default setting is to allow
155 -0.0.0.0/0,+192.168/16 deny all accesses, only allow 192.168/16 subnet
162 working directory. If absent (default), then accesses are not logged.
169 `-additional_header "X-Frame-Options: SAMEORIGIN"`
184 8. /index.lua with mg.request\_info.path\_info=='/some/path/file.ext'
188 Note: This example is valid, if the default configuration values for
200 This option can be used to enable or disable the use of the Linux `sendfile` system call.
201 It is only available for Linux systems and only affecting HTTP (not HTTPS) connections
219 addition to standard ones. The list must be comma-separated list
225 the default), CivetWeb looks at first line of a CGI script,
227 interpreter (not only on Linux and Mac but also for Windows).
230 `#!/path/to/php-cgi.exe` and `#!/path/to/perl.exe` must be first lines of the
233 server. If CivetWeb is started by mouse double-click on Windows, the current
237 more efficient to set `cgi_interpreter` to the path to `php-cgi.exe`.
239 Note that PHP scripts must use `php-cgi.exe` as executable, not `php.exe`.
242 All files that match `cgi_pattern` are treated as CGI files. The default pattern
244 use `/path/to/cgi-bin/**.cgi` as the pattern. Note that the full file path is
249 the server after this time. The default is "no timeout", so scripts may
257 A directory to serve. By default, the current working directory is served.
277 correct Content-Length HTTP header for each request. If this is forgotten the
282 keep\_alive\_timeout\_ms to 0. Currently, this is done as a default value,
301 working directory. If absent (default), then errors are not logged.
306 or slash (Linux, MacOS, ...).
308 404 - page requested by the client not found), a group of http status codes
309 (e.g., 4xx - all client errors) or all errors. The corresponding error pages
315 Extra mime types, in the form `extension1=type1,exten-sion2=type2,...`.
322 working directory. If set, per-directory `.htpasswd` files are ignored,
331 Password files may be generated using `CivetWeb -A` as explained above, or
332 online tools e.g. [this generator](http://www.askapache.com/online-tools/htpasswd-generator).
339 CivetWeb -hide_files_patterns secret.txt|**.hide
346 Comma-separated list of files to be treated as directory index files.
350 In case built-in Lua support has been enabled, `index.lp,index.lsp,index.lua`
351 are additional default index files, ordered before `index.cgi`.
354 Idle timeout between two requests in one keep-alive connection.
359 Unfortunately, browsers do not close the keep-alive connection after loading
361 The server closes a keep-alive connection, if there is no additional request
369 automatically use keep-alive if keep\_alive\_timeout\_ms is not 0.
375 Setting the value to -1 will turn off linger.
376 If the value is not set (or set to -2), CivetWeb will not set the linger
428 Comma-separated list of ports to listen on. If the port is SSL, a
430 port 80 and port 443, and connections on port 443 will be SSL-ed.
431 For non-SSL ports, it is allowed to append letter `r`, meaning 'redirect'.
437 an IP address and a colon must be pre-pended to the port number.
460 (in a Linux shell).
464 for most Linux distributions: /etc/hosts). E.g., to bind the IPv6
465 local host, you could use `ip6-localhost:80`. This translates to
471 environment - in some cases, you might need to resort to a fixed IP address.
506 If a client intends to keep long-running connection, either increase this
507 value or (better) use keep-alive messages.
516 civetweb -listening_ports 80 -run_as_user webserver
521 SSI is a simple interpreted server-side scripting language which is most
526 In order for a webpage to recognize an SSI-enabled HTML file, the filename
527 should end with a special extension, by default the extension should be
532 directives are supported, `<!--#include ...>` and
533 `<!--#exec "command">`. Note that the `<!--#include ...>` directive supports
536 <!--#include virtual="path"> Path is relative to web server root
537 <!--#include abspath="path"> Path is absolute or relative to
539 <!--#include file="path">, Path is relative to current document
540 <!--#include "path">
547 <!--#exec "ls -l" -->
571 Path to an SSL certificate chain file. As a default, the ssl\_certificate file is used.
585 Loads default trusted certificates locations set at openssl compile time.
591 ------------ | -------------
611 on a tmpfs (linux) on a system with very high throughput.
623 This option will set the `Cache-Control: max-age` value for static files.
634 Set the `Strict-Transport-Security` header, and set the `max-age` value.
641 or set to -1, no `Strict-Transport-Security` header will be sent.
642 For values <-1 and values >31622400, the behaviour is undefined.
651 0 Keep the default: Nagel's algorithm enabled
655 Limit download speed for clients. `throttle` is a comma-separated
662 The value is a floating-point number of bytes per second, optionally
667 *=1k,10.0.0.0/8=0 limit all accesses to 1 kilobyte per second,
668 but give connections the from 10.0.0.0/8 subnet
675 Comma-separated list of URL rewrites in the form of
688 CivetWeb -url_rewrite_patterns **.doc$=/path/to/cgi-bin/handle_doc.cgi
692 CivetWeb -url_rewrite_patterns /~joe/=/home/joe/,/~bill=/home/bill/
698 websockets may also be served from a different directory. By default,
714 the stand-alone executable. These options are not supported by other applications
723 icon. This option has no effect for Linux.
726 For Windows, use this website as a link in the systray, replacing the default
739 ----
742 Pre-built Windows and Mac CivetWeb binaries have built-in Lua scripting
745 Lua scripts (default extension: *.lua) use plain Lua syntax.
750 Lua Server Pages (default extensions: *.lsp, *.lp) are html pages containing
781 Lua is known for it's speed and small size. The default Lua version for
784 CivetWeb can be built with Lua 5.1, 5.2, 5.3, 5.4 (currently pre-release)
823 mg.read() -- reads a chunk from POST data, returns it as a string
824 mg.write(str) -- writes string to the client
825 mg.include(filename, [pathtype]) -- include another Lua Page file (Lua Pages only)
826 -- pathtype can be "abs", "rel"/"file" or "virt[ual]"
827 -- like defined for SSI #include
828 mg.redirect(uri) -- internal redirect to a given URI
829 mg.onerror(msg) -- error handler, can be overridden
830 mg.version -- a string that holds CivetWeb version
831 mg.document_root -- a string that holds the document root directory
832 mg.auth_domain -- a string that holds the HTTP authentication domain
833 mg.get_var(str, varname) -- extract variable from (query) string
834 mg.get_cookie(str, cookie) -- extract cookie from a string
835 mg.get_mime_type(filename) -- get MIME type of a file
836 mg.get_info(infotype) -- get server status information
837 mg.send_file(filename) -- send a file, including all required HTTP headers
838 mg.send_file_body(filename) -- send a file, excluding HTTP headers
839 mg.url_encode(str) -- URL encode a string
840 mg.url_decode(str, [form]) -- URL decode a string. If form=true, replace + by space.
841 mg.base64_encode(str) -- BASE64 encode a string
842 mg.base64_decode(str) -- BASE64 decode a string
843 mg.md5(str) -- return the MD5 hash of a string
844 mg.keep_alive(bool) -- allow/forbid to use http keep-alive for this request
845 mg.request_info -- a table with the following request information
846 .remote_addr -- IP address of the client as string
847 .remote_port -- remote port number
848 .server_port -- server port number
849 .request_method -- HTTP method (e.g.: GET, POST)
850 .http_version -- HTTP protocol version (e.g.: 1.1)
851 .uri -- resource name
852 .query_string -- query string if present, nil otherwise
853 .script_name -- name of the Lua script
854 .https -- true if accessed by https://, false otherwise
855 .remote_user -- user name if authenticated, nil otherwise
859 -- Connect to the remote TCP server. This function is an implementation
860 -- of simple socket interface. It returns a socket object with three
861 -- methods: send, recv, close, which are synchronous (blocking).
862 -- connect() throws an exception on connection error.
863 -- use_ssl is not implemented.
866 -- Example of using connect() interface:
867 local host = 'www.example.com' -- IP address or domain name
874 -- reply now contains the web page http://www.example.com/
891 mg.write('HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n')
896 Content-Type: text/html
903 <? mg.write('HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n') ?>
908 In this case, CivetWeb automatically creates a "200 OK"/"Content-Type: text/html"
914 HTML pages, while traditional CivetWeb syntax can be used to send a content-type
923 open(arg) -- callback to accept or reject a connection
924 ready(arg) -- called after a connection has been established
925 data(arg) -- called when the server receives data from the client
926 close(arg) -- called when a websocket connection is closed
975 ----
978 - PHP doesn't work - getting empty page, or 'File not found' error. The
980 the correct interpreter is `php-cgi.exe` (`php-cgi` on UNIX).
982 `CivetWeb -cgi_interpreter /full/path/to/php-cgi`
984 - `php-cgi` is unavailable, for example on Mac OS X. As long as the `php` binary is installed, you …
988 echo "Content-Type: text/html\r\n\r\n";
992 - CivetWeb fails to start. If CivetWeb exits immediately when started, this
994 (named `civetweb.conf` by default) or the command-line arguments.
1000 - Embedding with OpenSSL on Windows might fail because of calling convention.