-
-
Save semikolon/59888 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RE="ruby-enterprise-1.8.6-20081215" | |
PREFIX=/opt/$RE | |
VERSION=2.0.6 | |
GEM_PATH="$PREFIX/lib/ruby/gems/1.8/gems/passenger-$VERSION" | |
DOMAIN=odpiralnicasi.com | |
APP_ROOT=/srv/oc | |
# install Apache2 | |
apt-get install -qq apache2 apache2-prefork-dev | |
# download and install REE | |
cd /tmp | |
wget http://rubyforge.org/frs/download.php/48623/$RE.tar.gz -O- | tar xz | |
$RE/installer -a $PREFIX | ruby -e 'while gets; print "."; $stdout.flush; end' | |
# install necessary gems (Rails is auto-installed) | |
cd $PREFIX/bin | |
./gem install mojombo-grit mislav-will_paginate mattetti-googlecharts ryanb-acts-as-list haml thoughtbot-paperclip raspell bj | |
# install Passenger -- this step is INTERACTIVE | |
./passenger-install-apache2-module | |
# set up Apache to load the new module | |
echo "LoadModule passenger_module $GEM_PATH/ext/apache2/mod_passenger.so" > /etc/apache2/mods-available/passenger.load | |
ln -s ../mods-available/passenger.load /etc/apache2/mods-enabled/passenger.load | |
echo "PassengerRoot $GEM_PATH | |
PassengerRuby $PREFIX/bin/ruby" > /etc/apache2/mods-available/passenger.conf | |
ln -s ../mods-available/passenger.conf /etc/apache2/mods-enabled/passenger.conf | |
# mod_deflate | |
echo "<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml | |
</IfModule>" > /etc/apache2/mods-available/deflate.conf | |
ln -s ../mods-available/deflate.load /etc/apache2/mods-enabled/deflate.load | |
ln -s ../mods-available/deflate.conf /etc/apache2/mods-enabled/deflate.conf | |
# mod_rewrite | |
ln -s ../mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load | |
# set up a virtual host | |
echo "<VirtualHost *:80> | |
ServerName www.$DOMAIN | |
ServerAlias $DOMAIN *.$DOMAIN | |
DocumentRoot $APP_ROOT/current/public | |
RailsEnv production | |
RailsAllowModRewrite on | |
<LocationMatch "\.(js|css)$"> | |
SetOutputFilter DEFLATE | |
</LocationMatch> | |
</VirtualHost>" > /etc/apache2/sites-available/$DOMAIN | |
# link it up | |
rm -f /etc/apache2/sites-enabled/* | |
ln -s ../sites-available/$DOMAIN /etc/apache2/sites-enabled/$DOMAIN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment