$!----------------------------------------------------------------------------- $! ADHOC_SERVER_WRAPPER_V9.COM $! $! For WASD version 9 and earlier. $! $! Copy this procedure to another location and/or name. For example: $! $! $ COPY [EXAMPLE]ADHOC_SERVER_WRAPPER_V9.COM - $! [STARTUP]V930_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 HTTPD$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]V930_SERVER_WRAPPER.COM $! 2) create a version-specific server code directory $! $ CREATE /DIRECTORY [SRC.HTTPD930] $! 3) unzip the server source code into that directory $! $ SET DEFAULT [SRC.HTTPD930] $! $ UNZIP -j location:HTROOT930.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_930.EXE $! 6) edit to modify the wrapper procedure to use this specific image $! |$ server_image = "HT_EXE:HTTPD_SSL_930.EXE" $! 7) edit to make other adjustments to configuration file definitions, $! server parameters, account name, etc., e.g. $! |$ define HTTPD$SERVICE [LOCAL]V930_SERVICE.CONF $! 8) copy and/or edit ad hoc configuration file(s) as required $! $ COPY HTTPD$SERVICE [LOCAL]V930_SERVICE.CONF $! $ EDIT [LOCAL]V930_SERVICE.CONF $! 9) execute the procedure to create the detached server process $! $ @[STARTUP]V930_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 group number specified $! using the /ALL= qualifier. For example: $! $! $ HTTPD930 = "$HT_EXE:HTTPD_SSL_930.EXE/ALL=2" $! $ HTTPD930/DO=RESTART $! $ HTTPD930/DO=MAP $! $! A compatible HTTPDMON can similarly be used: $! $! $ HTTPDMON/ALL=2 $! $ HTTPDMON930 = "$HT_EXE:HTTPDMON_930.EXE/ALL=2" $! $ HTTPDMON930 $! $! COPYRIGHT $! --------- $! Copyright (C) 2009,2010 Mark G.Daniel $! This program, comes with ABSOLUTELY NO WARRANTY. $! This is free software, and you are welcome to redistribute it under the $! conditions of the GNU GENERAL PUBLIC LICENSE, version 3, or later version. $! http://www.gnu.org/licenses/gpl.txt $! $! VERSION HISTORY $! --------------- $! 03-NOV-2010 MGD bugfix; HTTPD$MSG missing $! 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 * $! **************************************************** $! $! define HTTPD$AUTH device:[directory]HTTPD_AUTH.CONF $! define HTTPD$CONFIG device:[directory]HTTPD_CONFIG.CONF $! define HTTPD$MAP device:[directory]HTTPD_MAP.CONF $! define HTTPD$MSG device:[directory]HTTPD_MSG.CONF $! define HTTPD$SERVICE device:[directory]HTTPD_SERVICE.CONF $! define HTTPD$SSL_CAFILE device:[directory]CA-BUNDLE_CRT.TXT $! define HTTPD$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_group = "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," +- "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_group) .eqs. "" then server_group = "2" $ error_count = 0 $! $ image_loop: $! $ set verify $ server_image /all='server_group' /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 $!-----------------------------------------------------------------------------