Skip to content

Instantly share code, notes, and snippets.

@mikegee
Created October 6, 2010 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikegee/614059 to your computer and use it in GitHub Desktop.
Save mikegee/614059 to your computer and use it in GitHub Desktop.
git clone git://github.com/osuclse/scarlet.git
cd scarlet
cat << EOF > config/database.yml
production:
adapter: mysql
database: scarlet
username: root
password: <Password you entered above>
host: localhost
pool: 5
timeout: 5000
test:
adapter: sqlite3
database: ":memory:"
verbosity: silent
sis:
adapter: sqlite3
database: db/fake_SIS.sqlite
EOF
bundle install --deployment --without duke
rake db:create
rake db:schema:load
rake
aptitude update
aptitude safe-upgrade
echo "127.0.0.1 scarlet.local" >> /etc/hosts
aptitude install mysql-server libmysqlclient15-dev
aptitude install ruby1.8 ruby1.8-dev libopenssl-ruby1.8 libxml2-dev libxslt1-dev libaspell-dev libsqlite3-dev build-essential zlib1g-dev imagemagick irb1.8 rdoc1.8
ln -s /usr/bin/ruby1.8 /usr/bin/ruby
ln -s /usr/bin/irb1.8 /usr/bin/irb
ln -s /usr/bin/rdoc1.8 /usr/bin/rdoc
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
tar xvzf rubygems-1.3.7.tgz
ruby rubygems-1.3.7/setup.rb
rm -r rubygems-1.3.7*
ln -s /usr/bin/gem1.8 /usr/bin/gem
gem install bundler
gem install rake
export RAILS_ENV=production
echo "export RAILS_ENV=production" >> /etc/profile
aptitude install git-core
mkdir /var/scarlet
useradd -d /var/scarlet -m scarlet
passwd scarlet
chown www-data:scarlet /var/scarlet
chmod 770 /var/scarlet
cd /var/scarlet
su scarlet
aptitude install apache2
a2enmod rewrite
aptitude install apache2-prefork-dev libapr1-dev libaprutil1-dev curl
gem install passenger
passenger-install-apache2-module
cat <<EOF > /etc/apache2/mods-available/passenger.load
LoadModule passenger_module `passenger-config --root`/ext/apache2/mod_passenger.so
PassengerRoot `passenger-config --root`
PassengerRuby /usr/bin/ruby1.8
EOF
a2enmod passenger
cat << EOF > /etc/apache2/sites-available/scarlet
<VirtualHost *:80>
ServerName scarlet.local
DocumentRoot /var/scarlet/scarlet/public
<Directory /var/scarlet/scarlet/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
EOF
a2ensite scarlet
/etc/init.d/apache2 reload
curl -s http://scarlet.local/ | grep '<title>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment