05 March 1999 StartSRE: Start and Monitor the SRE-http Web Server StartSRE is used to start and monitor the state of the SRE-http WWW server. It's major use is to detect when the server crashes, and then restart it. StartSRE is meant to be used in environments where SRE-http is likely to (occasionally) crash. Since the GoServe/SRE-http combination is fairly stable, this is mosly likely to occur when scripts and SRE-http addons are run. For example, the RXGDUTIL library, used by the GIF_TEXT SRE-http addon, can (for undetermined reasons) crash the process. By using StartSRE, this "crash" can be detected, with GoServe/SRE-http then restarted. Installation: 1) Copy STARTSRE.CMD to your GoServe\SRE-http directory. Actually, you can copy it anywhere, if you are willing to adjust a few parameters in STARTSRE.CMD If SRE-http is NOT installed in the same directory as GOSERVE.EXE; you MUST adjust these parameters (as described below). 2) As mentioned above, you may need (or want) to adjust a few parameters in STARTSRE.CMD. These parameters are at the top of the file, and are reasonably well documented. They are: IP_NAME: The ip name of the server. If left blank, the "own" ip name is used. Examples: ip_name='' ip_name='foo.bar.net' GOSERVE: The location of GOSERVE.EXE. If you installed, and run, STARTSRE.CMD from the GoServe directory, you can set GOSERVE='' Examples; goserve='' goserve='d:\apps\goserve' FILTER: The name of the filter (it should be in the directory you started STARTSRE from). By default, SREFILTR.80 is used, but you might want to use SREPROXY.80 or SRELITE.80 (or you might need to change the "port number"). Examples: filter='' filter='srefiltr.80' filter='sreproxy.8080' UPDATE: Frequency, in minutes, that StartSRE checks server status. More frequent updates will mean less time between "recoveries", but will increase server load. Example: update=5 LOGFILE: Events are written here (i.e.; a "restart server" message). Example: logfile='startsre.log' TRY_RESTART: Enable STARTSRE to try and kill, then restart, GoServe when certain "bad" errors are detected. Example: try_restart=1 Note: try_restart=0 is not recommended, since it suppresses the "restart GoServe if necessary" function of StartSRE. MAX_TIMEOUTS: If TRY_RESTART>0, then if more then MAX_TIMEOUTS consecutive timeouts (or other events causing a zero length response) occur, then kill and restart GoServe. Example: max_timeouts=8 FIRST_HIT: A request to use on the "first hit" to the server. This is used when STARTSRE is first invoked, and whenever a "restart GoServe" sequence occurs. Typically, you can use this to access the home page. If you do NOT want to use your own "request selector", set FIRST_HIT='' Examples: FIRST_HIT='' FIRST_HIT='/index.html' 3) CD to the directory in which you installed STARTSRE.CMD, and then run it. That is, from an OS/2 command prompt, type: D:\GOSERVE>startsre or D:\GOSERVE>start startsre 4) StartSRE will then start running; first checking to see if the designated server is running, starting GoServe if it's not. It will then start montitoring: checking the server's status, and restarting GoServe if a "crash" is detected. Note that status information will be written to the screen -- it's primitive, but it does let you know that things are working. Notes: * To stop GoServe, you'll need to first stop STARTSRE (Ctrl-C works), and then stop GoServe. Note that merely stopping GoServe is insufficient, since STARTSRE will detect a "crashed server", and restart GoServe. * STARTSRE can be used with any version of SRE-http; but is optimized for version 1.3b.1198b and above. Actually, with proper setting of parameters, STARTSRE can probably be run with any GoServe filter (we've not tested it....) * The RESTART addon is an alternative to STARTSRE (it's an addon that allows one to remotely, via your browser, restart GoServe/SRE).