Skip to content

Instantly share code, notes, and snippets.

@robinmonjo
Last active December 15, 2015 19:39
Show Gist options
  • Save robinmonjo/5313134 to your computer and use it in GitHub Desktop.
Save robinmonjo/5313134 to your computer and use it in GitHub Desktop.
set -e
sudo apt-get update
sudo apt-get install -y curl build-essential bison openssl libreadline6 libreadline6-dev git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf ssl-cert libcurl4-openssl-dev nginx
echo "Installing Ruby..."
echo " -> Downloading Ruby"
wget -q http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
echo " -> Extracting tarball"
tar xf ruby-1.9.3-p0.tar.gz
cd ruby-1.9.3-p0
echo " -> Configuring"
./configure --disable-install-doc >/dev/null
echo " -> Make"
make &>/dev/null
sudo make install >/dev/null
cd ..
rm -rf ruby-1.9.3-p0*
echo "Ruby installation done !"
echo "Installing MongoDB..."
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 &>/dev/null
echo " -> Installing"
sudo su -c "echo \"deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen\" >> /etc/apt/sources.list"
sudo apt-get update &>/dev/null
sudo apt-get install -y mongodb-10gen &>/dev/null
echo "MongoDB installation done !"
echo "Installing Redis..."
wget -q http://redis.googlecode.com/files/redis-2.4.5.tar.gz &>/dev/null
tar xzf redis-2.4.5.tar.gz &>/dev/null
cd redis-2.4.5
make >/dev/null
sudo make install >/dev/null
cd ..
rm -rf redis-* &>/dev/null
#sudo mkdir -p /usr/local/redis
#sudo mv /usr/local/redis/
#sudo mv /etc/init/
#sudo restart redis || sudo start redis
echo "Redis installation done !"
echo "Installing gems..."
if ! hash foreman &>/dev/null
then echo " -> Installing foreman"
sudo gem install foreman --no-ri --no-rdoc >/dev/null
fi
sudo gem install aws-s3 --no-ri --no-rdoc >/dev/null
sudo gem install bundler
echo "Gems installed !"
echo "Server installation is finished !"
echo "Installing node.js"
sudo apt-get install -y python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install -y nodejs npm
npm config set registry http://registry.npmjs.org/
#installing node dependencies
npm install express
npm install yamlparser
npm install mongodb
npm install mu2
npm install async
#creating git user with sudo right without password
echo "Creating git user"
sudo useradd git
echo "git ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment