Skip to content

Instantly share code, notes, and snippets.

@padde
Created October 9, 2011 15:22
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 padde/1273799 to your computer and use it in GitHub Desktop.
Save padde/1273799 to your computer and use it in GitHub Desktop.
Ubuntu 10.04 Server setup with Nginx, Passenger, Rails, PHP, Sqlite3, MySQL
#! /bin/bash
function info {
echo -e "\e[0;32m---------------------------------------------------------"
echo -e $1
echo -e "---------------------------------------------------------\e[0m"
}
info "Update system"
apt-get update
info "Install GIT"
yes | apt-get install git-core
info "Install Ruby"
yes | apt-get install ruby-full rubygems
yes | apt-get upgrade ruby
wget http://rubyforge.org/frs/download.php/75309/rubygems-1.8.10.tgz
tar xvfz rubygems-1.8.10.tgz
ruby rubygems-1.8.10/setup.rb
gem update --system
rm -rf rubygems*
info "Install node.js"
yes | apt-get install python-software-properties
yes | add-apt-repository ppa:chris-lea/node.js
yes | apt-get update
yes | apt-get install nodejs
info "Install Rails"
yes | apt-get install libreadline-ruby libruby libopenssl-ruby sqlite3 libsqlite3-ruby libsqlite-dev libsqlite3-dev
gem install rails --no-rdoc --no-ri
info "Install NGINX + Passenger"
gem install passenger
yes | apt-get install build-essential libcurl4-openssl-dev libssl-dev zlib1g-dev
passenger-install-nginx-module
curl https://raw.github.com/gist/1273601/ > /etc/init.d/nginx
chmod +x /etc/init.d/nginx
update-rc.d -f nginx defaults
info "Install PHP5 CGI"
yes | apt-get install php5-cgi
curl https://raw.github.com/gist/1273626/ > /etc/init.d/php-fastcgi
chmod +x /etc/init.d/php-fastcgi
update-rc.d -f php-fastcgi defaults
info "Install MySQL"
yes | apt-get install mysql-server
info "Restart server"
shutdown -r now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment