/usr/lib/ocaml/netcgi2/netcgi_ajp.mli is in libocamlnet-ocaml-dev 4.0.4-1build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | (* netcgi_ajp.mli
(C) 2005 Christophe Troestler
This code may be used under either, the GNU GPL, or the same license
as ocamlnet (see the file LICENSE).
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file
LICENSE for more details.
*)
(** Apache JServ Protocol (AJP) 1.3 connector.
*
* See the {!Netcgi_ajp.setup} section at the end of this file to know
* how to configure your web server.
*)
open Netcgi
val arg_parse :
(Arg.key * Arg.spec * Arg.doc) list -> Arg.anon_fun -> Arg.usage_msg
-> (string * string) list
(** [arg_parse speclist anon_fun usage_msg] parses the command line
and return an associative list describing the content of the
property file (see {!Netcgi_ajp.props_of_file}). This function
allows to fakes the "java" command (JVM startup):
- the option [-classpath <path>] is ignored;
- the first anonymous argument (Java class name) is ignored;
- the second anonymous argument is the name of the property file;
- other options are interpreted according to the [speclist].
@raise Failure and prints a usage message if the property file
cannot be read. *)
val props_of_file : string -> (string * string) list
(** [props_of_file fname] parses the property file [fname] and
returns it as an associative list. The following properties are
used:
- "bindaddress": The address the server socket is bound to. Can be
specified as IP address or hostname or "*" (default: "localhost").
- "port": The port number the server socket is bound to. Defaults to
8007.
- "security.authentication": If "true", the server expects that the
web server authenticates itself. Defaults to "true".
- "security.challengeSize": The length of the challenge string.
Defaults to 5.
- "security.secretKey": The file containing the secret key used for
authentication.
- "security.allowHost": Only the web server with this IP address is
allowed to connect (this option can occur several times).
DNS names are resolved at startup time.
- "jakarta.servletSubString": The substring that is used as indicator
for the servlet name (for mod_jk only). Defaults to "/servlets/".
- "ocamlnet.https": Whether HTTPS is assumed as basic protocol or not.
Defaults to "false".
Other properties are ignored.
@raise Invalid_argument if the file does not exist or is not readable.
*)
val run :
?props:(string * string) list ->
?config:config ->
?script_name:string ->
?allow:(Unix.sockaddr -> bool) ->
?output_type:output_type ->
?arg_store:arg_store ->
?exn_handler:exn_handler ->
?socket:Unix.file_descr ->
?sockaddr:Unix.sockaddr ->
?port:int ->
(cgi -> unit) -> unit
(** [run f] executes [f cgi] for each AJP request.
@param config Default: {!Netcgi.default_config}
@param allow Tells whether a connection from the socket is allowed.
Default: allow from all.
@param output_type Default: [`Direct ""]
@param arg_store Default: [`Automatic] for all arguments.
@param socket is a listening socket to use. Overrides [sockaddr]
and [port]
@param sockaddr The sockaddress (overrides [port])
@param port The port used by the web server to send the requests
(Default: 8009).
@param exn_handler See {!Netcgi.exn_handler}. Default: delegate
all exceptions to the default handler. *)
val handle_request :
?script_name:string ->
config -> output_type -> arg_store -> exn_handler ->
(cgi -> unit) -> log:(string -> unit) option ->
Unix.file_descr ->
connection_directive
(** [handle_request config output_type arg_store eh f ~log fd]: This
is a lower-level interface that processes exactly one request
arriving on the existing connection [fd].
[log] is the error logger function or [None], in which case
errors are passed through to the FCGI client.
The other arguments are just like for [run].
The return value indicates whether the connection can be kept
open or must be closed.
*)
val handle_connection :
config -> output_type -> arg_store -> exn_handler ->
(cgi -> unit) -> ?script_name:string -> Unix.file_descr ->
unit
(** [handle_connection config output_type arg_store eh f ?script_name fd]:
This is a lower-level interface that processes
exactly one connection [fd]. The descriptor is closed (even on
error).
The other arguments are just like for [run].
*)
(* ---------------------------------------------------------------------- *)
(** {2:setup Setup}
{3 Apache}
You need to use mod_jk to have support for AJP/1.3. To install
it, please see
{{:http://tomcat.apache.org/tomcat-3.3-doc/mod_jk-howto.html}Working
with mod_jk}.
In httpd.conf or in a file, say mod_jk.conf, in
/etc/apache2/conf.d/ (or /etc/apache2/conf.d/ for Apache 1.x), add
the following:
{v
# Shared memory file name (Unix only). The parent dir must exist.
JkShmFile /var/tmp/jk-runtime-status
LoadModule jk_module mod_jk.so
# Declare the module for <IfModule> (remove this line on Apache 2.x)
AddModule mod_jk.c
<IfModule mod_jk.c>
# Configure mod_jk
# Apache 1.x
#JkWorkersFile /etc/libapache-mod-jk/workers.properties
#JkLogFile /var/log/apache/mod_jk.log
# Apache 2.x
JkWorkersFile /etc/libapache2-mod-jk/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel info
# JkMount [URL prefix] [Worker name]
JkMount /*.jsp ajp13_worker
JkMount /servlet/* ajp13_worker
</IfModule>
v}
{3 Other web severs}
Please go to this
{{:http://tomcat.apache.org/connectors-doc/index.html}configuration
page}. Mail us specific instructions or tips for other web
servers so we can include them here.
{3 Workers.properties}
Here is an example of workers.properties:
{v
# Comma separated list of worker names:
worker.list=ajp13_worker
# Set properties for ajp13_worker
worker.ajp13_worker.type=ajp13
worker.ajp13_worker.host=localhost
worker.ajp13_worker.port=8009
worker.ajp13_worker.cachesize=1
v}
*)
|