| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- # based on: https://gist.github.com/statique/3783870
- # http://askubuntu.com/questions/31922/problem-installing-ruby-and-gems/31924#31924
- # https://github.com/wavedigital/Wave-Digital/wiki/PasswordlessSsh
- # rbenv inspired by https://gist.github.com/1441139
- # make sure running as root user
- apt-get -y update
- apt-get install linux-headers-2.6.32-5-amd64
- apt-get -y upgrade
- apt-get -y install curl git-core python-software-properties build-essential git-core curl libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev libcurl4-openssl-dev libxslt-dev libxml2-dev
- # sudo apt-get update && sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev -y
- # add-apt-repository
- curl -o /usr/sbin/add-apt-repository http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txtchmod o+x /usr/sbin/add-apt-repository
- chown root:root /usr/sbin/add-apt-repository
- # Apache
- apt-get install apache2
- apt-get install libapache2-mod-passenger
- service apache2 start
- # Node.jsadd-apt-repository ppa:chris-lea/node.js
- apt-get -y update
- apt-get -y install nodejs
- # Memcached
- apt-get -y install memcached
- service memcached start
- # Install Firewall
- apt-get -y install ufw
- ufw allow 22
- ufw allow 80
- ufw enable
- # rbenv
- # Install rbenv
- git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
- # Add rbenv to the path:
- echo '# rbenv setup' > /etc/profile.d/rbenv.sh
- echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
- echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
- echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
- chmod +x /etc/profile.d/rbenv.sh
- source /etc/profile.d/rbenv.sh
- # Install ruby-build:
- pushd /tmp
- git clone git://github.com/sstephenson/ruby-build.git
- cd ruby-build
- ./install.sh
- popd
- # Install Ruby 1.9.3-p194:
- rbenv install 1.9.3-p194
- rbenv global 1.9.3-p194
- cat << EOF > /root/.gemrc
- ---
- :verbose: true
- :bulk_threshold: 1000
- install: --no-ri --no-rdoc --env-shebang
- :sources:
- - http://gems.rubyforge.org/
- :benchmark: false
- :backtrace: false
- update: --no-ri --no-rdoc --env-shebang
- :update_sources: true
- EOF
- rbenv rehash
- gem update --system
- gem install bundler
- # Add deployer user
- adduser deployer --ingroup sudo
- su deployer
- shutdown -r now
|