contents

8. The Requester

The Requester recieves requests from an internet browser via a web server.

8.1 Setup

The Requester will be installed in the following path:
/usr/magicadm/cgibin
Two files are of interest for us:
  • mgrqcgi   - the Requester
  • mgreq.ini - the Ini-file of the Requester
These two files must be copied to the script directory of the web-server. In the directory
/etc/httpd
the settings for the Apache web-server are located. There you must look for "ScriptAlias". In Red Hat this directory is called "/home/httpd/cgi-bin" and in SuSE "/usr/local/httpd/cgi-bin". The two files must be copied there.

8.2 MGREG.INI

When the Requester is being initialized, "MGREQ.INI" is read.

[REQUESTER_ENV]  
Gateway =  1 Gateway Describes the middleware that will be used by a requester. Gateway = 1 means use Magic Broker. 
Syntax: Gateway = number
MessagingServer = 
AltMessagingServer = 
2001 The addresses of the Magic Request Brokers (MRB) that will receive the requests 
Syntax: MessagingServer = node name/port number
BrokerTimeout =    The maximum time, in seconds, that the request waits for an available engine to be returned by the MRB. If the MRB cannot provide an available engine within this time, the requester returns on of the following two error codes: 
APP-NOT-FOUND - the application is not listed in the MRB's internal database. 
APP-IN-USE - the application is listed but the supporting engine is busy. If the value is 0, the Magic engine never returned by the MRB. 
Syntax: BrokerTimeout = n
ServerTimeout =    The interval, in seconds, that the Magic engine will return an I-AM-ALIVE message during the task execution, for SYNC calls only. The client determines thetimeout interval when submitting the request. The equivalent for MAGIC.INI is the Communication Interval parameter in the Multi-User section of the Evironment dialog. 
If the value is 0, the Magic engine does not send I-AM-ALIVE messages to the requester. 
Syntax: ServerTimeout = n
RequesterTimeout =    The maximum time, in seconds, that the requesters waits for the completion of a task. If the value is 0, the completed task execution time is unlimited. 
Syntax: RequesterTimeout = n
Priority =  0 Optional. 
The default priority for requests that were not assigned a specific queue priority, 0 to 9 with 9 as the highest priority. The priority is used by the MRB only, to assign free engines to unprioritized requests. 
Syntax: Priority = 0
Username = 
Password = 
user 
pass
Optional. The default username and password that is submitted with requests that are unidentified. 
Syntax: 
Username = magicadm 
Password = magicpasswd
DefPath = 
DefName = 
  Optional. A directory and filename default for a requests specified without a filename. 
Syntax: 
DefPath = /usr/magicadm/cgi-bin/ 
DefName = webapp.html
DefHtml =    A filename that can be queried by an Internet requester that can be display if the called program does not retrun an HTML result.
HttpVars =  REMOTE_ADDR, 
REMOTE_HOST, 
REMOTE_IDENT, 
REMOTE_USER 
CONTENT_LENGTH, 
CONTENT_TYPE, 
GATEWAY_INTERFACE, 
HTTP_ACCEPT, 
HTTP_REFERER, 
HTTP_USER_AGENT, 
PATH_INFO, 
PATH_TRANSLATED, 
QUERY_STRING, 
REMOTE_ADDR, 
REMOTE_HOST, 
REMOTE_IDENT, 
REMOTE_USER, 
REQUEST_METHOD, 
SCRIPT_NAME, 
SERVER_NAME, 
SERVER_PORT, 
SERVER_PROTOCOL, 
SERVER_SOFTWARE
A list of enviroment variables that are sent from the Web server to the activated task, using different requesters: NSAPI, ISAPI, or CGI. Insert an space before and after "=" on no spaces between the variables! 
Syntax: httpVars = VarName1,VarName2
Appl =    Allowed application names separated by a comma. When not specified all applications are allowed. 
Syntax: Appl=applic 1, test 2, abc,...
LocalHost =     
Log =  REQ.LOG y s A log file that can be used to view the low-level activities of the Code Partitioning mechanism: sending and receiving messages & tcp/ip activities.One log file or several at a time can be used for all the components involved in the architecture : The Broker, The Engines & the Requesters (Magic 8 client, Command Line 
Requester, Internet Requesters).For the Broker & Magic 8 (Requester & Engine) this is the ONLY entry that will be relevant. All other entries will in as usual in MAGIC.INI. 
Syntax : Log=(FileName Sync Mode)FileName: Any valid name, not including spaces. 
Sync: 
  1. Y  The log file will be opened & closed for each line. This enables deletion of the file while components are still loaded in memory.
  2. N  The log file will be opened & closed only during the component initialization / termination, respectively.
  3. F  Each line to be printed will be flushed to the log file,but the log file will still be opened & closed only during the component initialization / termination.
Mode:
  1. C  Minimal. Only remote calls creation, submission (for Requesters) & execution (for the Broker & Engines). This mode will also display the parameters sent / received.
  2. S  Average. High level protocol (MRI) & low level protocol (TCP/IP) will also be displayed.
     
[MAGIC_MESSAGING_GATEWAYS]  
MGSRVR02 =  MGMQC20.dll, N, mq.log, LogSyncFlush, MQseries parameters  
MGSRVR02 =  MGMQS20.dll, N, mq.log, LogSyncFlush, MQseries parameters  
MGSRVR03 =  MGDQ.dll, N, dq.log, LogSyncFlush, Data-queue parameters  

contents