JANUS WEB: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (→‎Syntax: add MOVE method)
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:JANUS WEB}}
<span class="pageSubtitle">Define web port characteristics</span>
<span class="pageSubtitle"><section begin="desc" />Define web port characteristics<section end="desc" /></span>


The JANUS WEB command defines the rules for a <var class="product">[[Janus Web Server]]</var> running on a <var>[[JANUS DEFINE#type|WEBSERV]]</var> 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.
The <var>JANUS WEB</var> command defines the rules for a <var class="product">[[Janus Web Server]]</var> running on a <var>[[JANUS DEFINE#type|WEBSERV]]</var> 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==
==Syntax==
<p class="syntax"><section begin="syntax" /> JANUS WEB portname rule_type [method] url [optional parameters]
<p class="syntax"><span class="literal">JANUS WEB </span><span class="term">portname rule_type </span><span class="squareb">[</span><span class="term">method</span><span class="squareb">]</span><span class="term"> url </span><span class="squareb">[</span><span class="term">optional parameters</span><span class="squareb">]</span>
<section end="syntax" /></p>
</p>


The <var>JANUS WEB</var> 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 <var>JANUS WEB</var> commands are specified also affects how they are processed.  
The <var>JANUS WEB</var> 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 <var>JANUS WEB</var> commands are specified also affects how they are processed.  
Line 12: Line 11:
The first four parameters are positional, and all parameters are required but the method:
The first four parameters are positional, and all parameters are required but the method:


<table class="syntaxTable">
<table>
<tr><th>portname</th>
<tr><th>portname</th>
<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:
<td>The type of web rule that is being specified for the port. Valid values are:
<table class="syntaxTable">
 
<tr><th>[[JANUS WEB NOREDIRECT|NOREDIRECT]]</th>
<table>
<tr><th><var>[[JANUS WEB NOREDIRECT|NOREDIRECT]]</var></th>
<td>indicates no redirection</td></tr>
<td>indicates no redirection</td></tr>
<tr><th>[[JANUS WEB REDIRECT|REDIRECT]]</th>
 
<tr><th><var>[[JANUS WEB REDIRECT|REDIRECT]]</var></th>
<td>indicates redirection</td></tr>
<td>indicates redirection</td></tr>
<tr><th>[[JANUS WEB DISALLOW|DISALLOW]]</th>
 
<tr><th><var>[[JANUS WEB DISALLOW|DISALLOW]]</var></th>
<td>removes access permission</td></tr>
<td>removes access permission</td></tr>
<tr><th>[[JANUS WEB ALLOW|ALLOW]]</th>
 
<tr><th><var>[[JANUS WEB ALLOW|ALLOW]]</var></th>
<td>assigns access permission</td></tr>
<td>assigns access permission</td></tr>
<tr><th>[[JANUS WEB TYPE|TYPE]]</th>
 
<tr><th><var>[[JANUS WEB TYPE|TYPE]]</var></th>
<td>defines content type</td></tr>
<td>defines content type</td></tr>
<tr><th>[[JANUS WEB NODEBUG|NODEBUG]]</th>
 
<td>prevents JANUSDEBUG debugging</td></tr>
<tr><th><var>[[JANUS WEB NODEBUG|NODEBUG]]</var></th>
<tr><th>[[JANUS WEB DEBUG|DEBUG]]</th>
<td>prevents <var>JANUSDEBUG</var> debugging</td></tr>
<td>enables JANUSDEBUG debugging</td></tr>
 
<tr><th>[[JANUS WEB ON|ON]]</th>
<tr><th><var>[[JANUS WEB DEBUG|DEBUG]]</var></th>
<td>enables <var>JANUSDEBUG</var> debugging</td></tr>
 
<tr><th><var>[[JANUS WEB ON|ON]]</var></th>
<td>defines processing</td></tr>
<td>defines processing</td></tr>
<tr><th>[[JANUS WEB SCREEN|SCREEN]]</th>
 
<tr><th><var>[[JANUS WEB SCREEN|SCREEN]]</var></th>
<td>defines mapping of 3270 screen to HTML
<td>defines mapping of 3270 screen to HTML
</td></tr></table>
</td></tr></table>


The order in which the <var>JANUS WEB</var> rule types are shown above is the order in which they are processed. Within each <var class="term">rule_type</var>, rules are processed from most recent to oldest:
The order in which the <var>JANUS WEB</var> rule types are shown above is the order in which they are processed. Within each <var class="term">rule_type</var>, rules are processed from most recent to oldest:
<ol>
<li><var>REDIRECT</var> and <var>NOREDIRECT</var> rules are processed; if a redirection is specified, it is executed.<br />Otherwise:</li>
<li>Privileges are processed (<var>ALLOW</var> and <var>DISALLOW</var> rules).<br />If access to the URL is allowed:</li>
<li>A <var>TYPE</var> specification is obtained.</li>
<li>If a <var>DEBUG</var> is indicated, the request waits for a user to debug the request via the <var>[[JANUSDEBUG command|JANUSDEBUG]]</var> command.</li>
<li><var>ON</var> processing is invoked.</li>


<ol>
<li>A <var>SCREEN</var> mapping is established.</li>
<li>REDIRECT and NOREDIRECT rules are processed; if a redirection is specified, it is executed.<br />Otherwise:</li>
<li>Privileges are processed (ALLOW and DISALLOW rules).<br />If access to the URL is allowed:</li>
<li>A TYPE specification is obtained.</li>
<li>If a DEBUG is indicated, the request waits for a user to debug the request via the JANUSDEBUG command.</li>
<li>ON processing is invoked.</li>
<li>A SCREEN mapping is established.</li>
</ol>
</ol>
</td></tr>
</td></tr>


<tr><th>method</th>
<tr id="method"><th>method</th>


<td>The HTTP method(s) that applies to the rule. The <var class="term">method</var> value can be any of the following:
<td>The HTTP method(s) that applies to the rule. The <var class="term">method</var> value can be any of the following:
<table class="syntaxTable">
 
<tr><th>GET</th>
<table>
<tr><th><var>ANY</var></th>
<td>Any of the <var>JANUS WEB</var> supported HTTP methods (subject to the restriction that the length of the method name must not exceed 16 characters). </td></tr>
 
<tr><th><var>CONNECT</var></th>
<td>A request to a proxy to establish an HTTP tunnel. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>COPY</var></th>
<td>A request to create a duplicate of the specified source resource. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>DELETE</var></th>
<td>A request to delete the resource identified by the specified network address. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>GET</var></th>
<td>A simple request for a URL based on the URL name (includes HTTP GET and HTTP HEAD).</td></tr>
<td>A simple request for a URL based on the URL name (includes HTTP GET and HTTP HEAD).</td></tr>
<tr><th>POST</th>
 
<tr><th><var>GET+POST</var></th>
<td>The GET or POST method; the <var>JANUS WEB</var> default.</td></tr>
 
<tr><th><var>HEAD</var></th>
<td>This method is based on GET rules and is not used frequently (if at all) by most browsers.</td></tr>
 
<tr><th><var>LOCK</var></th>
<td>A request to take out a lock on the specified resource. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>MKCOL</var></th>
<td>A request to create a WebDAV collection at the specified location on the server. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>MOVE</var></th>
<td>A request to move the specified source resource to the indicated destination resource. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>OPTIONS</var></th>
<td>A request for information about the communication options available.
This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>OTHER</var></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). </td></tr>
 
<tr><th><var>PATCH</var></th>
<td>A request to apply changes to the specified resource. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>POST</var></th>
<td>A request for a URL that is accompanied by data from an HTML form.</td></tr>
<td>A request for a URL that is accompanied by data from an HTML form.</td></tr>
<tr><th>PUT</th>
<td>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.</td></tr>
<tr><th>GET+POST</th>
<td>The GET or POST method; the JANUS WEB default.</td></tr>
<tr><th>HEAD</th>
<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>
<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 <var class="product">Sirius Mods</var> Version 7.2.</td></tr>
<tr><th>ANY</th>
<td>Any HTTP method (subject to the restriction that the length of the method name must not exceed 16 characters). <blockquote> The ANY option includes the OTHER option. Prior to <var class="product">Sirius Mods</var> Version 7.2, the ANY option referred only to PUT, GET, POST, or HEAD. </blockquote>
</td></tr></table>


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.
<tr><th><var>PROPFIND</var></th>
<td>A request to retrieve properties, stored as XML, from the specified resource. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>PROPPATCH</var></th>
<td>A request to alter properties defined on the specified resource. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>PUT</var></th>
<td>A request to replace the contents of a URL, that is, a file upload. Note that while other methods have default <var>ALLOW</var> rules, which depend on the port type, PUT never has default <var>ALLOW</var> rules. That is, PUT is never permitted except by an explicit <var>JANUS WEB ALLOW</var> rule.</td></tr>
 
<tr><th><var>TRACE</var></th>
<td>A request to return the entire request message, as data for testing or diagnostic information. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
 
<tr><th><var>UNLOCK</var></th>
<td>A request to remove a lock on the specified resource. This method is supported as of version 7.7 of Model&nbsp;204.</td></tr>
</table>
 
By specifying a method on a <var>JANUS WEB</var> command, you indicate the rule is only to apply to that method. If no method is specified, <code>GET+POST</code> is assumed. </td></tr>
 
<tr><th>url</th>
<tr><th>url</th>
<td>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 <var class="term">url</var> 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 (<tt>*</tt>) as a "wildcard" indicator (<code>*.jpg</code> thus specifies any URL with a <code>.jpg</code> suffix).


<td>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 <var class="term">url</var> 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 (<tt>*.jpg</tt> thus specifies any URL with a .jpg suffix). <blockquote> 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 <tt>*.pdf</tt> may not recognize a request for a file of type PDF. </blockquote> The <var class="term">url</var> value can also be the name of an [[JANUS WEB exception rules|exception condition]].
<p class="note"><b>Note:</b> Janus port definitions include the <var>UPCASE</var> 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 <var>TYPE</var> rule that uses the pattern <code>*.pdf</code> may not recognize a request for a file of type PDF. </p>
</td></tr>
<p>
The <var class="term">url</var> value can also be the name of an [[JANUS WEB exception rules|exception condition]].</p></td></tr>


<tr><th>optional parameters</th>
<td>The optional parameters allowed for the JANUS WEB command depend on the <var class="term">rule_type</var> that was specified; see the [[List of JANUS WEB subcommands]].
</table>
</table>


The optional parameters allowed for the JANUS WEB command depend on the <var class="term">rule_type</var> that was specified.
The <var>[[JANUS CLSOCK]]</var> and <var>[[JANUS SRVSOCK]]</var> commands are used by <var class="product">[[Janus Sockets]]</var> to establish rules for <var>CLSOCK</var> ports and SRVSOCK ports, respectively. Note that the <var>JANUS WEB</var> command differs from the corresponding rules available with the <var>JANUS CLSOCK</var> and <var>JANUS SRVSOCK</var> commands in the following ways:


The [[JANUS CLSOCK]] and [[JANUS SRVSOCK]] commands are used by <var class="product">[[Janus Sockets]]</var> to establish rules for <var>CLSOCK</var> ports and SRVSOCK ports, respectively. .do end Note that the JANUS WEB command differs from the corresponding rules available with the <var>JANUS CLSOCK</var> and <var>JANUS SRVSOCK</var> commands in the following ways:
<ul>
<li><var>JANUS WEB</var> does not allow any optional parameters (for example, <var>USGROUP</var>) on the <var>DISALLOW</var> rule. </li>


<ul>
<li>The default access for <var>WEBSERV</var> non-SSL ports and <var>SRVSOCK</var> ports is <var>ALLOW</var>. The default access for <var>WEBSERV</var> SSL ports and <var>CLSOCK</var> ports is <var>DISALLOW</var>. </li>
<li><var>JANUS WEB</var> does not allow any optional parameters (for example, <var>USGROUP</var>) on the <var>DISALLOW</var> rule.
 
<li>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.  
<li><var>ALLOW</var> and <var>DISALLOW</var> are the only rule types for <var>JANUS CLSOCK</var> and <var>JANUS SRVSOCK</var>; there are a number of other rule types for <var>JANUS WEB</var>.</li>
<li>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.
</ul>
</ul>


Line 94: Line 156:
<li>[[Defining Web rules]]
<li>[[Defining Web rules]]
<li>[[JANUS WEB rule matching order and examples]]
<li>[[JANUS WEB rule matching order and examples]]
<li>[[JANUS WEB exception rules]]  
<li>[[JANUS WEB exception rules]]
<li>[[List of Janus Web Server $functions]]  
</ul>
</ul>


[[Category:JANUS WEB subcommands|JANUS WEB]]
[[Category:JANUS WEB subcommands|JANUS WEB]]
[[Category:Janus commands|JANUS WEB]]
[[Category:Janus commands|JANUS WEB]]
[[Category:Janus Web Server|JANUS WEB command]]

Latest revision as of 00:52, 19 August 2016

Define web port characteristics

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

JANUS WEB portname rule_type [method] url [optional parameters]

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:

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

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.
method The HTTP method(s) that applies to the rule. The method value can be any of the following:
ANY Any of the JANUS WEB supported HTTP methods (subject to the restriction that the length of the method name must not exceed 16 characters).
CONNECT A request to a proxy to establish an HTTP tunnel. This method is supported as of version 7.7 of Model 204.
COPY A request to create a duplicate of the specified source resource. This method is supported as of version 7.7 of Model 204.
DELETE A request to delete the resource identified by the specified network address. This method is supported as of version 7.7 of Model 204.
GET A simple request for a URL based on the URL name (includes HTTP GET and HTTP HEAD).
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.
LOCK A request to take out a lock on the specified resource. This method is supported as of version 7.7 of Model 204.
MKCOL A request to create a WebDAV collection at the specified location on the server. This method is supported as of version 7.7 of Model 204.
MOVE A request to move the specified source resource to the indicated destination resource. This method is supported as of version 7.7 of Model 204.
OPTIONS A request for information about the communication options available. This method is supported as of version 7.7 of Model 204.
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).
PATCH A request to apply changes to the specified resource. This method is supported as of version 7.7 of Model 204.
POST A request for a URL that is accompanied by data from an HTML form.
PROPFIND A request to retrieve properties, stored as XML, from the specified resource. This method is supported as of version 7.7 of Model 204.
PROPPATCH A request to alter properties defined on the specified resource. This method is supported as of version 7.7 of Model 204.
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.
TRACE A request to return the entire request message, as data for testing or diagnostic information. This method is supported as of version 7.7 of Model 204.
UNLOCK A request to remove a lock on the specified resource. This method is supported as of version 7.7 of Model 204.
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).

Note: 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.

optional parameters The optional parameters allowed for the JANUS WEB command depend on the rule_type that was specified; see the List of JANUS WEB subcommands.

The JANUS CLSOCK and JANUS SRVSOCK commands are used by Janus Sockets to establish rules for CLSOCK ports and SRVSOCK ports, respectively. 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.

See also