Using HP Serviceguard for Linux to Provide High Availability for LAMP, December 2005

High availability for Separate LAMP configuration
Figure 2: Apache and MySQL running as separate packages in a Separate LAMP configuration
In this configuration, the MySQL database and Apache Web server (with PHP) can run
on separate machines. Failure of one application or node results in a restart of only that
application on its adoptive node.
Here Apache and MySQL would run as separate Serviceguard packages. This would
mean that with this configuration in a production environment, one can do rolling
upgrades of the database or web server independently. This configuration offers more
flexibility.
Configuring LAMP for high availability
This section details the procedure for deploying the LAMP stack in a high availability
environment. The setup described below makes a few assumptions. It assumes that
Serviceguard for Linux is installed on all the nodes of the cluster and that both Apache
and MySQL as well as their toolkit binaries are installed on all target nodes.
Separate LAMP configuration
Apache and MySQL in this configuration will run as separate Serviceguard for Linux
packages. Both Apache and MySQL will have a separate set of package configuration
and package control files.
Please follow the instructions in the Apache and MySQL toolkit READMEs and the steps
listed in the section “Additional Configuration Steps” to install and configure Apache and
MySQL as separate Serviceguard for Linux packages. In addition, the procedures
described in the sections “SELinux Considerations” and “Toolkit Script Modifications” of
this whitepaper must be completed before the packages can be run.
The PHP pages served by the Apache web server reside in Apache’s Document Root
directory. If the Document Root is local then synchronization across servers should be
maintained by replicating the PHP files on all target nodes. In case of a shared Document
root, synchronization across servers is automatically taken care of.
Web
Pk
g
A
A
pac
h
e
Server A
Serve
r B
Pk
g
B
M
ySQ
L
5