Created
November 21, 2010 14:01
-
-
Save joakimk/708758 to your computer and use it in GitHub Desktop.
Install script for Apache+REE+Passenger 3 on Ubuntu 10.04 64bit
This file contains hidden or 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
# Install script for Apache+REE+Passenger 3 on Ubuntu 10.04 64bit | |
# BEFORE: | |
# - Make sure you are logged as a non-root user that can sudo. | |
# - Add your key here: | |
SSH_KEY="ssh-rsa ..." | |
# Add key to admin user | |
mkdir -p .ssh && echo "$SSH_KEY" >> .ssh/authorized_keys || exit 1 | |
# Apache2, REE and Passenger | |
sudo apt-get install wget ssh build-essential libcurl4-openssl-dev apache2-dev apache2 -y && | |
wget http://rubyforge.org/frs/download.php/71098/ruby-enterprise_1.8.7-2010.02_amd64_ubuntu10.04.deb && | |
sudo dpkg -i ruby-enterprise_1.8.7-2010.02_amd64_ubuntu10.04.deb && | |
rm ruby-enterprise_1.8.7-2010.02_amd64_ubuntu10.04.deb && | |
sudo gem install passenger -v 3.0.0 && | |
sudo /usr/local/bin/passenger-install-apache2-module -a || exit 1 | |
# Config | |
cp /etc/apache2/apache2.conf /tmp/apache2.conf && | |
echo "" >> /tmp/apache2.conf && | |
echo "ServerName $(hostname)" >> /tmp/apache2.conf && | |
echo "LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/ext/apache2/mod_passenger.so" >> /tmp/apache2.conf && | |
echo "PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.0" >> /tmp/apache2.conf && | |
echo "PassengerRuby /usr/local/bin/ruby" >> /tmp/apache2.conf && | |
sudo mv /tmp/apache2.conf /etc/apache2/apache2.conf && | |
sudo /etc/init.d/apache2 restart || exit 1 | |
# Deploy user | |
sudo useradd -m -s /bin/bash deploy && | |
mkdir /tmp/deploy_ssh && | |
echo "$SSH_KEY" >> /tmp/deploy_ssh/authorized_keys && | |
sudo chown -R deploy:deploy /tmp/deploy_ssh && | |
sudo mv /tmp/deploy_ssh /home/deploy/.ssh || exit 1 | |
echo "TODO: Setup virtual hosts, etc.." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment