This package will transform the A10-AX series load balancer config
into a more human friendly format.  see screenshot.png for an example.


####
## NOTE, words in CAPITALS need to be changed, below
##       example.com should be changed to your domain name
##
## this is just one way of installing.  many others will work.
####

# update repo
#yum update

# install apache
yum install httpd

# install mod perl
yum install mod_perl

# install mod ssl
yum install mod_ssl



mkdir -p /home/hostedsites
cd /home/hostedsites
tar -zxf lbconfig.tgz
rm -r lbconfig/logs/*
rm -r lbconfig/data/cache/*

# tell apache about the new virtualserver
cd lbconfig/data/httpd
ln -s `pwd`/lbconfig.conf /etc/httpd/conf.d/lbconfig.conf

# set up the ca and certs
cd ssl
openssl genrsa -out ca.key 1024
openssl req -new -key ca.key -out ca.csr
 # US
 # State server is in
 # City server is in
 # Company
 # Department
 # lbconfig.example.com
 # <ENTER>
 # <ENTER>
 # <ENTER>
openssl x509 -req -days 3650 -in ca.csr -signkey ca.key -out ca.crt
cd ..
chown -R apache:apache ssl
chmod -R o-rwx ssl

# set up usernames and passwords for the load balancers
cd ..
vi config
# format: <hostname>:<colo>:<zone>:<color>:<username>:<password>

cd ../www
# configure username/password to view the website
echo "username:`mkpasswd password`" > httpd/htpasswd

# add to crontab:
#
## manage apache logs
1 0 * * * /home/hostedsites/lbconfig/data/scripts/logmgr.sh


# if it's a new server,
echo 'NameVirtualHost *:80' > /etc/httpd/conf.d/local.conf

# if it's a new server or hasn't done SSL in the past,
echo 'NameVirtualHost *:443' >> /etc/httpd/conf.d/local.conf


# make logs in a sane space
ln -s /var/log/httpd /var/log/apache
chmod go+r /var/log/httpd


# update the main code
# inside the BEGIN block near the top, change the homedir
chown apache:apache index.mpl
chmod ug+x index.mpl


# install/update some perl modules
sudo cpan
 o conf prerequisites_policy follow
 install XML::Simple
 install LWP
 install CGI
 install Time::HiRes


# turn on apache
/etc/init.d/httpd start
chkconfig httpd on