Kazoo cluster pre-req functions (Whistle) - CentOS 5.6

by tjmosley
5 deployments · 0 still active · last rev. 4 years ago

This a collection of functions used to build base servers for a Kazoo cluster.

Compatible with: No distros currently supported
						#!/bin/bash

function system_update {
  yum -y update
}

function enable_epel {
        rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
}

function update_erlang_epel {
		wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo
}

function install_erlang {
                yum install erlang
}

function add_local0_log {
		echo -e "local0.*\t\t\t\t\t\t/var/log/local0.log" >> /etc/syslog.conf
		/etc/init.d/syslog restart
}

function install_kazoo_prereqs {
		yum install -y make ncurses ncurses-devel openssl openssl-devel gcc gcc-c++ java-1.6.0-openjdk java-1.6.0-openjdk-devel unixODBC-devel
		yum install -y autoconf automake wget libtool libjpeg-devel sox libvorbis libvorbis-devel libogg libogg-devel flex libxml2
		yum install -y hg libxslt python python-devel python-simplejson zip unzip bison bison-devel zlib zlib-devel
		yum install -y git js-devel libicu libicu-devel openssl openssl-devel python python-devel 
}

function install_curl {
		wget http://curl.haxx.se/download/curl-7.20.1.tar.gz -P /usr/src/
		tar -xzf /usr/src/curl-7.20.1.tar.gz -C /usr/src/
		cd /usr/src/curl-7.20.1
		./configure --prefix=/usr/local && make && make install
}

function install_mysql {
                # MySQL Install and Configure first DB
                mysql_install "$DB_PASSWORD" && mysql_tune 40
}
function install_freeswitch {
		# CD into the sourcecode directory...
		cd /usr/local/src

		# Use GIT to grab freeswitch...
		git clone git://git.freeswitch.org/freeswitch.git

		# CD into the freeswitch code directory...
		cd /usr/local/src/freeswitch

		##
		## FREESWITCH INSTALLATION
		##
		#
		# All of this is done in one line, to allow fallthrough on-failure...
		#
		# Bootstrap for the freeswitch configuration...
		./bootstrap.sh
		# Configure the freeswitch code for compilation...
		./configure
		# BUILD FREESWITCH -- 5 parallel jobs (Linodes have 4 cores)...
		make -j5
		# INSTALL FREESWITCH
		make install
		# INSTALL FREESWITCH SOUNDS -AND- MOH
		make all cd-sounds-install cd-moh-install
		# BRING UP FREESWITCH IN DAEMON MODE
		cd /usr/local/freeswitch/bin
		./freeswitch -ncwait

		# Install PHP with Apache, and tune PHP
		php_install_with_apache && php_tune
		# Post-Setup and Tune Apache
		apache_install && apache_tune 40
}