Skip to content

Instantly share code, notes, and snippets.

@jamiew
Created July 14, 2009 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jamiew/146607 to your computer and use it in GitHub Desktop.
Save jamiew/146607 to your computer and use it in GitHub Desktop.
# setting up an R&D slice
# 1st things first, copy over our bash & screen config...
# TODO:
# bootstrap
apt-get update -y && apt-get upgrade -y
apt-get install -y build-essential git-core
apt-get install -y apache2 apache2-prefork-dev postfix imagemagick
apt-get install -y mysql-server
apt-get install -y ruby ruby1.8-dev rubygems rdoc irb libmysqlclient15-dev libyaml-ruby libzlib-ruby sqlite3
apt-get install -y memcached
apt-get install -y munin-node monit
apt-get install -y screen
# TODO:
# redis?
# ...
# rubygems
gem install --no-rdoc --no-ri rubygems-update
# && gem update --system
gem install --no-rdoc --no-ri daemons fastthread hpricot json mime-types mysql open4 passenger rack rake rails sqlite3-ruby thor thin rspec
apt-get install libxml2 libxslt libxslt-dev
gem install --no-rdoc --no-ri hpricot mechanize nokogiri
gem install --no-rdoc --no-ri htmlentities chronic oauth unicode giraffesoft-is_taggable i76-has_slug
# install starling
gem sources -a http://gems.github.com/
gem install --no-rdoc --no-ri fiveruns-memcache-client starling-starling
# moar starling -- from http://craiccomputing.blogspot.com/2009/01/setting-up-starling-messaging-server.html
# FIXME: version-dependent...
# TODO: adduser starling
ln -s /opt/ruby-enterprise/bin/starling* /usr/local/bin/*
mkdir -p /var/spool/starling /var/log/starling
cp /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/starling-starling-0.10.0/etc/starling.ubuntu /etc/init.d/starling
vi /etc/init.d/starling
# DUSER=root
# DGROUP=root
# LISTEN=192.168.1.1
# install passenger
# as of 2009-07-13: Version 1.8.6-20090610 for Ubuntu 8.04 (64-bit)
# 32bit: http://rubyforge.org/frs/download.php/58679/ruby-enterprise_1.8.6-20090610_i386.deb
wget http://rubyforge.org/frs/download.php/58678/ruby-enterprise_1.8.6-20090610_amd64.deb
/opt/ruby-enterprise/bin/passenger-install-apache2-module
# tweak apache
ln -s /var/log/apache2 /var/log/httpd
ln -s /etc/apache2 /etc/httpd
cd /etc/apache2/mods-enabled
cp ../mods-available/rewrite* .
vi status.conf
# TODO: add ExtendedStatus On
# passenger install
vi /etc/apache2/mods-enabled/passenger.load
## PASTE:
# 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
# passenger conf
# # max processes; each is around 100MB to start and can grow to >200MB (more under error conditions)
# PassengerMaxPoolSize 10
# PassengerMaxInstancesPerApp 10
#
# # this is the normal idle time
# #PassengerPoolIdleTime 300
# # 0 means never shut them down unless 100% necessary
# PassengerPoolIdleTime 0
#
# # but restart each one after N reqests in case we leak memory
# #PassengerMaxRequests 10000
# PassengerMaxRequests 2000
#
# # how often to hit disk to check for config.ru etc. (seconds)
# # 0 = unlimited
# PassengerStatThrottleRate 3
# configure munin
apt-get install -y munin-node
vi /etc/default/monit # and enable
# TODO: allow rbstage to grab this munin-node
# TODO: munin-manager checkout + plugins
# configure monit
apt-get install -y monit
vi /etc/monit/monitrc
# TODO: load a default config
invoke-rc.d monit start
## Lastly, install our app via cap deploy remotely...
mkdir -p ~/magma/releases
mkdir -p ~/magma/shared/public ~/magma/shared/config ~/magma/shared/log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment