Skip to content

Instantly share code, notes, and snippets.

@sterrym
Created September 1, 2009 15:26
Show Gist options
  • Save sterrym/179156 to your computer and use it in GitHub Desktop.
Save sterrym/179156 to your computer and use it in GitHub Desktop.
#!/bin/bash
# ec2-run-instances --key build --user-data-file ec2-userdata.sh --group default --group basic ami-ed46a784
set -e -x
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get upgrade -y
# ruby
wget http://rubyforge.org/frs/download.php/58679/ruby-enterprise_1.8.6-20090610_i386.deb
dpkg -i ruby-enterprise_1.8.6-20090610_i386.deb
ln -s /opt/ruby-enterprise/ /opt/ruby
# put ruby-enterprise into the main path
mkdir -p /usr/local/bin
rubybin=/opt/ruby/bin
for file in $( ls $rubybin ) ; do ln -nfs $rubybin/$file /usr/local/bin/$file; done
# apache
apt-get install -y apache2 apache2-prefork-dev libapr1-dev
# passenger
/usr/local/bin/passenger-install-apache2-module -a
echo "LoadModule passenger_module /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.2
PassengerRuby /opt/ruby-enterprise/bin/ruby" > /etc/apache2/conf.d/passenger
/etc/init.d/apache2 restart
# mysql
apt-get install -y mysql-server mysql-client libmysqlclient15-dev
# memcached
apt-get install -y memcached
# git
apt-get install -y git-core
# gems
/usr/local/bin/gem install --no-rdoc --no-ri mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment