Created
February 9, 2011 02:11
-
-
Save chyld/817757 to your computer and use it in GitHub Desktop.
Install Ruby, Rails, MySql, Apache, Passenger on Ubuntu 10.10 on Amazon EC2
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
#amazon ec2 image | |
#ubuntu 10.10, 64bit | |
#east-coast : ami-cef405a7 | |
#west-coast : ami-af7e2eea | |
#ssh to ec2 | |
ssh -i <key-file>.pem ubuntu@<ip-address-to-ec2> | |
#change ssh timeouts | |
sudo vi /etc/ssh/sshd_config | |
#add these settings | |
ClientAliveInterval 30 | |
TCPKeepAlive yes | |
ClientAliveCountMax 99999 | |
#restart ssh | |
sudo /etc/init.d/ssh restart | |
#add packages to base system | |
sudo apt-get update | |
sudo apt-get install build-essential | |
sudo apt-get install zlib1g-dev | |
sudo apt-get install tcl8.5 | |
sudo apt-get install libreadline6 libreadline6-dev | |
sudo apt-get install libssl-dev | |
sudo apt-get install libcurl4-openssl-dev | |
#install git | |
wget http://kernel.org/pub/software/scm/git/git-1.7.4.tar.bz2 | |
tar -jxvf git-1.7.4.tar.bz2 | |
cd git-1.7.4 | |
./configure | |
make | |
sudo make install | |
cd | |
#install rvm | |
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) | |
vi .bashrc | |
#add these to .bashrc to show current ruby version and gemset | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. | |
PS1="\$(~/.rvm/bin/rvm-prompt) $PS1" | |
#log out and back in so .bashrc settings can take effect | |
#install ruby | |
rvm install 1.9.2 | |
#switch to version 1.9.2 | |
rvm 1.9.2 | |
#create gemset to install rails | |
rvm gemset create rails3 | |
#set ruby 1.9.2 and rails3 gemset as default | |
rvm 1.9.2@rails3 --default | |
#test ruby installation | |
irb | |
exit | |
#install rails | |
gem install rails |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment