1
0

ubuntusetup-apache-rails 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # based on: https://gist.github.com/statique/3783870
  2. # http://askubuntu.com/questions/31922/problem-installing-ruby-and-gems/31924#31924
  3. # https://github.com/wavedigital/Wave-Digital/wiki/PasswordlessSsh
  4. # rbenv inspired by https://gist.github.com/1441139
  5. # make sure running as root user
  6. apt-get -y update
  7. apt-get install linux-headers-2.6.32-5-amd64
  8. apt-get -y upgrade
  9. 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
  10. # 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
  11. # add-apt-repository
  12. 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
  13. chown root:root /usr/sbin/add-apt-repository
  14. # Apache
  15. apt-get install apache2
  16. apt-get install libapache2-mod-passenger
  17. service apache2 start
  18. # Node.jsadd-apt-repository ppa:chris-lea/node.js
  19. apt-get -y update
  20. apt-get -y install nodejs
  21. # Memcached
  22. apt-get -y install memcached
  23. service memcached start
  24. # Install Firewall
  25. apt-get -y install ufw
  26. ufw allow 22
  27. ufw allow 80
  28. ufw enable
  29. # rbenv
  30. # Install rbenv
  31. git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
  32. # Add rbenv to the path:
  33. echo '# rbenv setup' > /etc/profile.d/rbenv.sh
  34. echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
  35. echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
  36. echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
  37. chmod +x /etc/profile.d/rbenv.sh
  38. source /etc/profile.d/rbenv.sh
  39. # Install ruby-build:
  40. pushd /tmp
  41. git clone git://github.com/sstephenson/ruby-build.git
  42. cd ruby-build
  43. ./install.sh
  44. popd
  45. # Install Ruby 1.9.3-p194:
  46. rbenv install 1.9.3-p194
  47. rbenv global 1.9.3-p194
  48. cat << EOF > /root/.gemrc
  49. ---
  50. :verbose: true
  51. :bulk_threshold: 1000
  52. install: --no-ri --no-rdoc --env-shebang
  53. :sources:
  54. - http://gems.rubyforge.org/
  55. :benchmark: false
  56. :backtrace: false
  57. update: --no-ri --no-rdoc --env-shebang
  58. :update_sources: true
  59. EOF
  60. rbenv rehash
  61. gem update --system
  62. gem install bundler
  63. # Add deployer user
  64. adduser deployer --ingroup sudo
  65. su deployer
  66. shutdown -r now