Sample configurations

Running two versions of httpd for Linux

This example shows how two versions of httpd can run from different locations. In group Apache_1, httpd runs from Port 80, the default location. The configuration file in /usr/local/apache/conf/httpd.conf should indicate DocumentRoot, address, port, and other parameters. In group Apache_2, httpd runs from /home/web/apache. The PID file for this is created in /home/web/apache/logs/httpd.pid. The configuration file in /home/web/apache/conf/httpd.conf should define parameters for running this version of httpd.

Each Apache resource requires an online IP resource. In this example, each Apache resource requires an online mount resource to mount block devices from disks reserved by the Disk Reservation agent.

system sysa

system sysb

group Apache_1 (

SystemList = { sysa ,sysb}

AutoStartList = { sysa}

)

Apache myapacheWeb (

httpdDir = "/mnt/apache/bin"

SecondLevelMonitor = 1

ConfigFile = "/mnt/apache/conf/httpd.conf"

HostName = "server1.example.com"

Port = 80

)

IP myapacheIP(

Device = "eth0"

Address="192.168.50.50"

NetMask="255.255.255.0"

)

NIC myapacheNIC(

Device="eth0"

NetworkHosts={"172.29.9.178","172.29.9.179"}

)

Mount myapacheMnt(

MountPoint="/mnt/apache/"

BlockDevice="/dev/sdd2"

)

DiskReservation myapacheDiskRes(

Disks ="/dev/sdd"

)

myapacheMnt requires myapacheDiskRes

myapacheIP requires myapacheNIC

myapacheWeb requires myapacheIP

myapacheWeb requires myapacheMnt

group Apache_2 (

SystemList = { sysa,sysb}

AutoStartList = { sysa}

)

Apache myapacheWeb2(

httpdDir = "/mnt/apache1/bin"

SecondLevelMonitor = 1

ConfigFile = "/mnt/apache1/conf/httpd.conf"

HostName = "server2.example.com"

Port = 8080

)

IP myapacheIP2(

Device = "eth1"

Address="192.168.60.50"

NetMask="255.255.255.0"

)

NIC myapacheNIC2(

Device="eth1"

)

Mount myapacheMnt2(

MountPoint="/mnt/apache1/"

BlockDevice="/dev/sdc3"

)

DiskReservation myapacheDiskRes2(

Disks ="/dev/sdc"

)

myapacheMnt2 requires myapacheDiskRes2

myapacheIP2 requires myapacheNIC2

myapacheWeb2 requires myapacheIP2

myapacheWeb2 requires myapacheMnt2


Sample main.cf file

include "types.cf"

cluster Cluster1 (

UserNames = { admin = xxxxxx }

)

system SystemA (

)

system SystemB (

)

group Web1 (

SystemList = { SystemA = 0, SystemB = 1 }

)

DiskGroup Web1_dg (

DiskGroup = web1

)

Volume Web1_vol (

DiskGroup = web1

Volume = volweb1

)

IP Web1_ip (

Device = eth0

Address = "10.212.88.220"

NetMask = "255.255.254.0"

)

Mount Web1_mnt (

MountPoint = "/apache/srvr01"

BlockDevice = "/dev/vx/dsk/web1/volweb1 "

FSType = vxfs

FsckOpt = "-y"

)

NIC Web1_nic (

Device = eth0

)

Apache Web1_http (

HostName = spartan

Port = 80

SecondLevelMonitor = 1

SecondLevelTimeout = 25

httpdDir = "/apache/srvr01/bin"

EnvFile = "/apache/srvr01/bin/envvars"

PidFile = /apache/srvr01/log/httpd.pid"

ConfigFile = "/apache/srvr01/conf/httpd.conf"

IntentionalOffline = 1

)

Web1_ip requires Web1_nic

Web1_mnt requires Web1_vol

Web1_vol requires Web1_dg

Web1_http requires Web1_ip

Web1_http requires Web1_mnt

Basic IPv6 configuration

The following is a basic IPv6 configuration for the resource.

group ipv6group (

SystemList = { sysA = 0, sysB = 1 }

)

Apache ipv6group_apache_res (

HostName = "fd4b:454e:205a:110:211:25ff:fe7e:118"

PidFile = "/myapache/apache/logs/httpd.pid"

httpdDir = "/myapache/apache/bin"

ConfigFile = "/myapache/apache/conf/httpd.conf"

ResLogLevel = TRACE

SecondLevelTimeout = 20

IntentionalOffline = 1

)

DiskGroup ipv6group_dg_res (

DiskGroup = dg01

)

IP ipv6group_ip_res (

Device = eth0

Address = "fd4b:454e:205a:110:211:25ff:fe7e:118"

PrefixLen = 64

)

Mount ipv6group_mnt_res (

MountOpt = rw

FsckOpt = "-n"

BlockDevice = "/dev/vx/dsk/dg01/vol01"

MountPoint = "/myapache/apache"

FSType = vxfs

)

NIC ipv6group_nic_res (

Device = eth0

)

Volume ipv6group_vol_res (

Volume = vol01

DiskGroup = dg01

)

ipv6group_apache_res requires ipv6group_mnt_res

ipv6group_apache_res requires ipv6group_ip_res

ipv6group_mnt_res requires ipv6group_vol_res

ipv6group_vol_res requires ipv6group_dg_res

ipv6group_ip_res requires ipv6group_nic_res