WordPress/Cluster Configuration

From MattWiki

This article will explain how to build a WordPress site, or a group of WordPress sites, on a cluster of 2 or more servers, using a Rackspace Cloud Load Balancer[1].

Installing needed Software

Update your install and added the needed software for the site.

yum -y update
yum -y install httpd mysql-server php php-mysql mod_security git subversion postfix

Configure the newly installed programs to start when the server is rebooted.

chkconfig httpd on
chkconfig mysqld on
chkconfig postfix on

Configuring the Firewall (Iptables)

Configure the firewall to allow remote connections to port 80.

echo "*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT"> /etc/sysconfig/iptables

Configuring Apache

Getting Ready

With everything configured, were ready to start the software.

service iptables restart
service mysqld start
service httpd start
service postfix start

Database Setup

After everything starts "OK", we need to create a databases for WordPress to run in.

mysqladmin create wordpress

References