Skip to content

Instantly share code, notes, and snippets.

@Sitebase
Created December 1, 2012 17:42
Show Gist options
  • Save Sitebase/4183435 to your computer and use it in GitHub Desktop.
Save Sitebase/4183435 to your computer and use it in GitHub Desktop.
EC2 Bootstrap LAMP
#!/bin/bash
logger="logger -t bbbx-boot"
install()
{
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y \
-o DPkg::Options::=--force-confdef \
-o DPkg::Options::=--force-confold \
install $@
}
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get upgrade -y
# role selection
echo "Init instance with role: $INSTANCEROLE"
$logger "Install dependencies"
$logger "Install Git"
install git
if [ "$INSTANCEROLE" == "red5" ]; then
$logger "RED5 SERVER"
$logger "Add dependencies to sources list"
echo "deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse" >> /etc/apt/sources.list
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ lucid multiverse" >> /etc/apt/sources.list
echo "deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse" >> /etc/apt/sources.list
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse" >> /etc/apt/sources.list
$logger "Install java package"
install java-package
$logger "Install java jdk"
install sun-java6-jdk
$logger "Install java jre"
install sun-java6-jre
$logger "Install ant"
install ant
$logger "Install subversion"
install subversion
$logger "Download and install Red5"
wget http://www.red5.org/downloads/red5/1_0/red5-1.0.0-RC2.tar.gz
tar xvfz red5-1.0.0-RC2.tar.gz
mv red5-1.0.0 red5
mv red5 /usr/share/
else
tasksel install lamp-server
echo "Please remember to set the MySQL root password!"
$logger "Install ffmpeg"
install ffmpeg
$logger "Install php5-cli"
install php5-cli
$logger "Inst
all php-dev"
install php5-dev
$logger "Install php-pear"
install php-pear
$logger "Install wkhtmltopdf"
install wkhtmltopdf
# Overwrite basic index
$logger "Set home page text"
echo 'Welcome to the Gist installed BuboBox server' > /var/www/index.html
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment