$!----------------------------------------------------------------------------- $! 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:_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= 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 ! !!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 $!-----------------------------------------------------------------------------