JANUS WEB: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 20: Line 20:
<td>The 1- to 30-character name of the port for which the access and URL processing rules are being defined.</td></tr>
<td>The 1- to 30-character name of the port for which the access and URL processing rules are being defined.</td></tr>
<tr><th>rule_type</th>
<tr><th>rule_type</th>
 
<td>The type of web rule that is being specified for the port. Valid values are:
<table class="syntaxTable">
<table class="syntaxTable">
<td>The type of web rule that is being specified for the port. Valid values are:</td></tr>
<tr><th>NOREDIRECT</th>
<tr><th>NOREDIRECT</th>
<td>indicates no redirection</td></tr>
<td>indicates no redirection</td></tr>
Line 42: Line 41:
<td>defines mapping of 3270 screen to HTML
<td>defines mapping of 3270 screen to HTML
</td></tr></table>
</td></tr></table>
 
</td></tr>


The order in which the JANUS WEB rule types are shown above is the order in which they are processed. Within each <i>rule_type</i>, rules are processed from most recent to oldest:
The order in which the JANUS WEB rule types are shown above is the order in which they are processed. Within each <i>rule_type</i>, rules are processed from most recent to oldest:
Line 69: Line 68:
<td>This method is based on GET rules and is not used frequently (if at all) by most browsers.</td></tr>
<td>This method is based on GET rules and is not used frequently (if at all) by most browsers.</td></tr>
<tr><th>OTHER</th>
<tr><th>OTHER</th>


<td>All methods other than PUT, GET, POST, and HEAD (subject to the restriction that the length of the method name must not exceed 16 characters). This option is available as of ''[[Sirius Mods]]'' Version 7.2.</td></tr>
<td>All methods other than PUT, GET, POST, and HEAD (subject to the restriction that the length of the method name must not exceed 16 characters). This option is available as of ''[[Sirius Mods]]'' Version 7.2.</td></tr>
Line 103: Line 101:
[[Category:JANUS WEB subcommands|JANUS WEB]]
[[Category:JANUS WEB subcommands|JANUS WEB]]
[[Category:Janus commands|JANUS WEB]]
[[Category:Janus commands|JANUS WEB]]
[[Category:Sirius commands|JANUS WEB]]
[[Category:Commands|JANUS WEB]]

Revision as of 22:00, 2 March 2011

<section begin="desc" />WEB<section end="desc" />


The JANUS WEB command defines the rules for a Janus Web Server running on a WEBSERV port. Web rules control access and routing of URL requests, and they can cause a request for a URL to initiate a complex database process.

Syntax

<section begin="syntax" /> JANUS WEB portname rule_type [method] url - [optional parameters] <section end="syntax" />

JANUS WEB command syntax


The JANUS WEB command differs from most Janus commands in that it usually takes a set of commands to fully specify the rules that give a web server its characteristics. For instance, it may take a number of commands to specify user ID access, to restrict the range of IP addresses that may connect, and then to specify the server's routing and behavior based on different types of requested URLs. The order in which JANUS WEB commands are specified also affects how they are processed.

The first four parameters are positional, and all parameters are required but the method:

The order in which the JANUS WEB rule types are shown above is the order in which they are processed. Within each rule_type, rules are processed from most recent to oldest:
  1. REDIRECT and NOREDIRECT rules are processed; if a redirection is specified, it is executed.

    Otherwise:
  2. Privileges are processed (ALLOW and DISALLOW rules).

    If access to the URL is allowed:
  3. A TYPE specification is obtained.
  4. If a DEBUG is indicated, the request waits for a user to debug the request via the JANUSDEBUG command.
  5. ON processing is invoked.
  6. A SCREEN mapping is established.
portname The 1- to 30-character name of the port for which the access and URL processing rules are being defined.
rule_type The type of web rule that is being specified for the port. Valid values are:
NOREDIRECT indicates no redirection
REDIRECT indicates redirection
DISALLOW removes access permission
ALLOW assigns access permission
TYPE defines content type
NODEBUG prevents JANUSDEBUG debugging
DEBUG enables JANUSDEBUG debugging
ON defines processing
SCREEN defines mapping of 3270 screen to HTML
method
The HTTP method(s) that applies to the rule. The method value can be any of the following:
GET A simple request for a URL based on the URL name (includes HTTP GET and HTTP HEAD).
POST A request for a URL that is accompanied by data from an HTML form.
PUT A request to replace the contents of a URL, that is, a file upload. Note that while other methods have default ALLOW rules, which depend on the port type, PUT never has default ALLOW rules. That is, PUT is never permitted except by an explicit JANUS WEB ALLOW rule.
GET+POST The GET or POST method; the JANUS WEB default.
HEAD This method is based on GET rules and is not used frequently (if at all) by most browsers.
OTHER All methods other than PUT, GET, POST, and HEAD (subject to the restriction that the length of the method name must not exceed 16 characters). This option is available as of Sirius Mods Version 7.2.
ANY Any HTTP method (subject to the restriction that the length of the method name must not exceed 16 characters).

The ANY option includes the OTHER option. Prior to Sirius Mods Version 7.2, the ANY option referred only to PUT, GET, POST, or HEAD.


By specifying a method on a JANUS WEB command, you indicate the rule is only to apply to that method. If no method is specified, GET+POST is assumed.url



Universal Resource Locator (URL). Every web request contains a URL, which can be considered to specify the "name" or "identity" of the "object" being requested. For example, the URL may specify the name of a file or the name (and some parameters) of an application. The url specified in the JANUS WEB command is a case-sensitive pattern, which is compared to the requested URL; the last rule that matches the URL is the rule that applies. The pattern can include an asterisk (*) as a "wildcard" indicator (*.jpg thus specifies any URL with a .jpg suffix).

Janus port definitions include the UPCASE specification by default. If you define a web rule using a lowercase URL, the rule may fail in the default case where the incoming URL is converted to uppercase. For example, a TYPE rule that uses the pattern *.pdf may not recognize a request for a file of type PDF.

The url value can also be the name of an exception condition (see JANUS WEB Exception rules).


The optional parameters allowed for the JANUS WEB command depend on the rule_type that was specified. The various rule types are shown in the following sections, followed by a section giving examples and showing the interaction of JANUS WEB commands (JANUS WEB Rule matching order and examples), and a section explaining exception URLs (JANUS WEB Exception rules).

The JANUS CLSOCK and JANUS SRVSOCK commands, described in the Janus TCP/IP Base Reference Manual, are used by Janus Sockets to establish rules for CLSOCK ports and SRVSOCK ports, respectively. .do end Note that the JANUS WEB command differs from the corresponding rules available with the JANUS CLSOCK and JANUS SRVSOCK commands in the following ways:

  • JANUS WEB does not allow any optional parameters (for example, USGROUP) on the DISALLOW rule.
  • The default access for WEBSERV non-SSL ports and SRVSOCK ports is ALLOW. The default access for WEBSERV SSL ports and CLSOCK ports is DISALLOW.
  • ALLOW and DISALLOW are the only rule types for JANUS CLSOCK and JANUS SRVSOCK; there are a number of other rule types for JANUS WEB.


References

See: List of Janus commands and List of JANUS WEB subcommands