You can prepare JCL procedures to start and stop IBM® HTTP Server
from the MVS™ system
console.
By using a JCL cataloged procedure to issue the apachectl start and stop
commands, you can start and stop an IBM HTTP Server instance from the MVS system console.
Other apachectl commands can be issued from the MVS system console using the same procedure.
Copy the following sample JCL procedure from SHAPJCL(HAPAPROC) to your
system procedure library:
//*---------------------------------------------------------
//IHSAPACH PROC ACTION='start',
// DIR='/path/to/IHS/runtime/directory',
// CONF='conf/httpd.conf'
//*---------------------------------------------------------
//IHS EXEC PGM=BPXBATCH,
// PARM='SH &DIR/bin/apachectl -k &ACTION -f &CONF -DNO_DETACH',
// MEMLIMIT=512M
//STDOUT DD PATH='&DIR/logs/proc.output',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=(SIRUSR,SIWUSR,SIRGRP,SIWGRP)
//STDERR DD PATH='&DIR/logs/proc.errors',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=(SIRUSR,SIWUSR,SIRGRP,SIWGRP)
// PEND
A description of the apachectl command used in the sample
JCL can be found at the Apache HTTP Server Control Interface Web site.
The default jobname for the IBM HTTP Server instance will be the same
as the member name of the cataloged procedure. In the examples below, a procedure
name of WEBSRV1 is used. Edit the new cataloged procedure by replacing
/path/to/IHS/runtime/directory with
the actual installation directory for this instance of IBM HTTP Server. Create a SAF STARTED profile
to associate the server user ID and group with the Web server started task:
RDEFINE STARTED WEBSRV1.* STDATA(USER(WWWSERV) GROUP(WWWGROUP) TRACE(YES))
SETROPTS RACLIST(STARTED) GENERIC(STARTED) REFRESH
The output files for the start and stop commands are:
- install_directory/logs/proc.output
- install_directory/logs/proc.errors
Best Practice 1: The output files are overwritten
each time the procedure is used. They might contain warning messages about
the configuration or error messages for startup failures. If you want to
retain a log of these messages across multiple uses of the procedure, modify
the two occurrences of the PATHOPTS option in the sample procedure to PATHOPTS=(OCREAT,OAPPEND,OWRONLY).
For more information on the PATHOPTS option, refer to the z/OS® MVS JCL Reference (SA22-7597).
Link to this document from the z/OS Internet Library.
Best Practice 2: The STDENV DD statement is not recommended.
You might consider adding environment variable settings to the bin/envvars file
within the runtime directory so that the variables are active whether IBM HTTP
Server is started from JCL or from the UNIX® environment.
Best Practice 3: The SH parameter of BPXBATCH is recommended instead of the PGM
parameter. Processing for the PGM parameter bypasses system default settings
in the /etc/profile file, including the umask setting,
and files created by IBM HTTP Server do not have the correct permissions.