Run multiple, independent instances of IBM® HTTP Server from a single installation. It
is seldom necessary to run multiple instances, as features like virtual
hosts allow a single instance to efficiently serve many sites, but
it some cases it is necessary. If you need to securely administer
your sites by different administrators, for example, you must run
separate instances that each use their own configuration files.
Before you begin
This topic is primarily for AIX®,
HP-UX, Linux, Solaris, and Windows operating systems. On
the z/OS® platform, the install_ihs
command creates a separate directory for each instance without creating
another copy of the product.
See the z/OS topic
for configuring IBM HTTP Server
for more information. Before configuring
multiple instances, consider if your problem can be solved by using
virtual hosts and/or having IBM HTTP
Server listen on multiple addresses and ports. The advantage of a
single instance is that it uses less resources to serve the same requests
as multiple instances.
Avoid trouble: When you follow the
examples, change "this_instance" to a unique name for each instance.
gotcha
Procedure
- Create a separate main configuration file, normally the
httpd.conf file, for each instance.
Best practice: To
reduce duplication, store common directives in common files and import
these into the separate, main configuration files with the
Include directive.
bprac
We'll call the configuration file conf/this_instance.conf for the
rest of these steps. Here is a simple example of
a configuration file for an instance:
Listen 10.0.0.1:80
PidFile instance1/httpd.pid
ErrorLog instance1/error.log
CustomLog instance1/access.log common
# Other directives that make this instance behave uniquely
Include conf/common.conf
A real configuration file would
have more directives in it to make this instance behave differently
than the other instances.
- Configure the port settings in the configuration files. You cannot use a combination of listen port and listen IP address
for more than one instance. Check the Listen directives in each configuration
file, and verify that they are unique. See information on the Listen
directive for Apache HTTP Server for more information.
- Configure settings for logging and other special files. Any files that are normally stored in the install_root/logs
directory cannot be shared between instances. Each instance must have
unique values for the following directives:
- PidFile
- Applicable to all configurations. See the information on the PidFile
directive for Apache HTTP Server.
- ScriptSock
- Applicable to non-Windows configurations with mod_cgid enabled.
- ErrorLog
- Applicable to all configurations. See the information on the ErrorLog
directive for Apache HTTP Server.
- CustomLog or TransferLog
- Applicable to all configurations. See the information on the CustomLog
directive or the TransferLog directive for Apache HTTP Server.
- SSLCachePortFilename
- Applicable to all non-Windows configurations with SSL enabled.
See the information on the SSLCachePortFilename directive.
- SSLCachePath
- Applicable when all of the following conditions are true:
- Platform is not Windows.
- SSL is enabled.
- SSLCacheDisable directive is not configured.
- bin/apachectl has been modified to specify a different -d flag,
or bin/apachectl is launched with an explicit -d flag.
- The directory specified by the -d flag does not contain the file
bin/sidd.
See the information on the SSLCachePath directive for Apache
HTTP Server. See information on the SSLCachePath directive.
- Other optional directives that specify a file path, like logging
or tracing.
![[AIX]](../images/aixlogo.gif)
Ensure that no more than one IHS
instance has the fast response cache accelerator (FRCA), or AFPA,
enabled. Note: FRCA/AFPA has been deprecated starting with
V7.0 and its use is discouraged. There is no support for Windows Vista, Windows 2008, or any later Windows operating systems.
- Start or stop the IHS server instance.
![[AIX]](../images/aixlogo.gif)
![[HP-UX]](../images/hpux.gif)
![[Linux]](../images/linux.gif)
Use these commands to start
and stop IHS:# cd /install_dir
# bin/apachectl -k start -f conf/this_instance.conf
# bin/apachectl -k stop -f conf/this_instance.conf
Alternatively,
you can create a copy of apachectl for each instance, and update the
commands in each copy to include "-f conf/this_instance.conf".
Use these commands to setup a new instance:cd \install_dir
bin\Apache.exe -f conf/this_instance.conf -k install -n IHS-this_instance
Choose
one of these commands to start and stop IHS:
See the topic on starting and stopping IBM HTTP Server for more information.