[0001]
[0002]
[0003]
[0004]
[0005]
[0006]
[0007]
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
[0102]
[0103]
[0104]
[0105]
[0106]
[0107]
[0108]
[0109]
[0110]
[0111]
[0112]
[0113]
[0114]
[0115]
[0116]
[0117]
[0118]
[0119]
[0120]
[0121]
[0122]
[0123]
[0124]
[0125]
[0126]
[0127]
[0128]
[0129]
[0130]
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137]
[0138]
[0139]
[0140]
[0141]
[0142]
[0143]
[0144]
[0145]
[0146]
[0147]
[0148]
[0149]
[0150]
[0151]
[0152]
[0153]
[0154]
[0155]
[0156]
[0157]
[0158]
[0159]
[0160]
[0161]
[0162]
[0163]
[0164]
[0165]
[0166]
[0167]
[0168]
[0169]
[0170]
[0171]
[0172]
[0173]
[0174]
[0175]
[0176]
[0177]
[0178]
[0179]
[0180]
[0181]
[0182]
[0183]
[0184]
[0185]
[0186]
[0187]
[0188]
[0189]
[0190]
[0191]
[0192]
[0193]
[0194]
[0195]
[0196]
$!-----------------------------------------------------------------------------
$! ADHOC_SERVER_WRAPPER.COM
$!
$! For WASD version 10 and later.
$!
$! Copy this procedure to another location and/or name.  For example:
$!
$!   $ COPY [EXAMPLE]ADHOC_SERVER_WRAPPER.COM [STARTUP]V1000_SERVER_WRAPPER.COM
$!
$! Make required modifications to the copy.
$!
$! This procedure allows another, autonomous server process and image to be
$! executed concurrently with the standard environment.  The configuration can
$! be tailored as required by using one or more configuration files specific
$! to this procedure and specified using logical names defined below.  More
$! than one of these ad hoc environments can be used concurrently.  The
$! standard environment operates as group 1.  The first ad hoc environment by
$! has been allocated to group 2.  Additional concurrent ad hoc environments
$! should specify a server group 3 through to 15 (the maximum).
$!
$! This is intended to allow regression testing between server versions.
$! Multiple instances in the environment are not supported.
$! It is not intended for use as a production environment.
$!
$! Uses default site configuration files unless changes are made below.
$! Uses the default server image (version) unless changes are made below.
$! Writes a server process output log into HT_SERVER_LOGS:
$!
$! At the very least WASD_CONFIG_SERVICE will require an ad hoc configuration
$! file with unique services specified to prevent the ad hoc server from
$! attempting to instantiate the same services as the standard (production)
$! environment.
$!
$! BE AWARE you may need to clean up behind this ad hoc servery (for example
$! if the global section used is permanent, unINSTALL image, etc.)
$!
$! EXAMPLE USAGE
$! -------------
$! Example of building another server version from source code and using
$! it as an ad hoc server:
$!
$!  1) use a local copy of the procedure suitable for customisation
$!     $ COPY [EXAMPLE]ADHOC_SERVER_WRAPPER.COM -
$!     [STARTUP]V1000_SERVER_WRAPPER.COM
$!  2) create a version-specific server code directory
$!     $ CREATE /DIRECTORY [SRC.HTTPD1000]
$!  3) unzip the server source code into that directory
$!     $ SET DEFAULT [SRC.HTTPD1000]
$!     $ UNZIP -j location:HTROOT1000.ZIP */httpd/*.*
$!  4) build the server image (with optional (WASD) "SSL", or "VMS_SSL")
$!     $ @BUILD_HTTPD SSL
$!  5) rename the new server image to a version-specific name
$!     $ RENAME HT_EXE:HTTPD_SSL.EXE HT_EXE:HTTPD_SSL_1000.EXE
$!  6) edit to modify the wrapper procedure to use this specific image
$!     |$ server_image = "HT_EXE:HTTPD_SSL_1000.EXE"
$!  7) edit to make other adjustments to configuration file definitions,
$!     server parameters, account name, etc., e.g.
$!     |$ define WASD_CONFIG_SERVICE [LOCAL]V1000_SERVICE.CONF
$!  8) copy and/or edit ad hoc configuration file(s) as required
$!     $ COPY WASD_CONFIG_SERVICE [LOCAL]V1000_SERVICE.CONF
$!     $ EDIT [LOCAL]V1000_SERVICE.CONF
$!  9) execute the procedure to create the detached server process
$!     $ @[STARTUP]V1000_SERVER_WRAPPER.COM
$! 10) look for the ad hoc server process
$!     $ SHOW SYSTEM /OWNER=HTTP$SERVER
$! 11) check the server process log when troubleshooting
$!     $ DIRECTORY/DATE HT_SERVER_LOGS: /SINCE=-0-00:05:00
$!     $ TYPE HT_SERVER_LOGS:<node>_20090711015014.LOG
$!
$! BE AWARE that there can be build dependencies between server versions
$! and HTTPDMON and SSL, and of course configuration directive differences.
$!
$! COMMAND-LINE
$! ------------
$! The server process can be controlled from the command-line as per usual
$! provided the appropriate server image is used and the environment number
$! specified using the /ENV=<integer> qualifier.  For example:
$!
$!   $ HTTPD1000 = "$HT_EXE:HTTPD_SSL_1000.EXE/ENV=2"
$!   $ HTTPD1000/DO=RESTART
$!   $ HTTPD1000/DO=MAP
$!
$! A compatible HTTPDMON can similarly be used:
$!
$!   $ HTTPDMON/ENV=2
$!   $ HTTPDMON1000 = "$HT_EXE:HTTPDMON_1000.EXE/ENV=2"
$!   $ HTTPDMON1000
$!
$! COPYRIGHT
$! ---------
$! Copyright (C) 1996-2021 Mark G.Daniel.
$!
$! Licensed under the Apache License, Version 2.0 (the "License");
$! you may not use this file except in compliance with the License.
$! You may obtain a copy of the License at
$!
$!    http://www.apache.org/licenses/LICENSE-2.0
$!
$! Unless required by applicable law or agreed to in writing, software
$! distributed under the License is distributed on an "AS IS" BASIS,
$! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
$! See the License for the specific language governing permissions and
$! limitations under the License.
$!
$! VERSION HISTORY
$! ---------------
$! 03-NOV-2010  MGD  bugfix; WASD_CONFIG_MSG
$! 11-OCT-2009  MGD  adapted to WASD v10
$! 11-JUL-2009  MGD  initial
$!-----------------------------------------------------------------------------
$!
$ delete /symbol/local/all
$ define = "define/process"
$ if f$mode() .nes. "OTHER" then define = "!"
$!
$! ****************************************************
$! *  UNCOMMENT AND MODIFY THE FOLLOWING AS REQUIRED  *
$! ****************************************************
$!
$! @WASD_FILE_DEV  !<integer> !!environment number if required
$!
$! define  WASD_CONFIG_AUTH        device:[directory]HTTPD_AUTH.CONF
$! define  WASD_CONFIG_CONFIG      device:[directory]HTTPD_CONFIG.CONF
$! define  WASD_CONFIG_MAP         device:[directory]HTTPD_MAP.CONF
$! define  WASD_CONFIG_MSG         device:[directory]HTTPD_MSG.CONF
$! define  WASD_CONFIG_SERVICE     device:[directory]HTTPD_SERVICE.CONF
$! define  WASD_CONFIG_SSL_CAFILE  device:[directory]CA-BUNDLE_CRT.TXT
$! define  WASD_CONFIG_SSL_CERT    device:[directory]HTTPD.PEM
$!
$! server_image = "HT_EXE:HTTPD_SSL.EXE"
$! server_params = "/GBLSEC=NOPERM/SYSUAF=(ID,SSL)"
$! server_account = "HTTP$SERVER"
$! server_environ = "2"
$!
$! **********************************
$! *  DO NOT MODIFY ANYTHING BELOW  *
$! **********************************
$! (without knowing exactly what you're doing!)
$!
$!-----------------------------------------------------------------------------
$!
$ if f$mode() .nes. "OTHER"
$ then
$!   (interactive, detach the ad hoc server process)
$    this_procedure = f$environment("procedure")
$    if f$type(server_image) .eqs. "" then server_image = "HT_EXE:HTTPD_SSL.EXE"
$    install = "$sys$system:install/command_mode"
$    instprv = "ALTPRI,CMKRNL,DETACH,PRMGBL,PRMMBX,PSWAPM," +-
               "SECURITY,SYSGBL,SYSLCK,SYSPRV,SYSNAM,WORLD"
$    if f$getsyi("arch_name") .eqs. "VAX" then instprv = instprv + ",SHMEM"
$    define /user sys$output nl:
$    define /user sys$error nl:
$    install remove 'server_image'
$    install add 'server_image' /privilege=('instprv')
$    if f$extract(0,1,server_image) .nes. "$" then server_image = "$" + server_image
$    if f$type(server_account) .eqs. "" then server_account = "HTTP$SERVER"
$    server_image /version
$    server_image /detach /user='server_account' 'this_procedure'
$    exit
$ endif
$!
$!-----------------------------------------------------------------------------
$!
$!(detached server process)
$ if f$type(server_image) .eqs. "" then server_image = "$HT_EXE:HTTPD_SSL.EXE"
$ if f$extract(0,1,server_image) .nes. "$" then server_image = "$" + server_image
$ if f$type(server_params) .eqs. "" then server_params = ""
$ if f$type(server_environ) .eqs. "" then server_environ = "2"
$ error_count = 0
$!
$ image_loop:
$!
$    set verify
$ server_image /env='server_environ' /instance=1 'server_params'
$!   'f$verify(0)
$!
$!   (non-error exit, must be a restart, loop immediately)
$    status = $status
$    if status
$    then
$       error_count = 0
$       goto image_loop
$    endif
$    if status .eq. ss$_duplnam then exit
$!
$    error_count = error_count + 1
$    if error_count .lt. 120
$       then wait 00:00:15
$       else wait 00:15:00
$    endif
$    goto image_loop
$!
$ end_image_loop:
$!
$ exit
$!-----------------------------------------------------------------------------