Skip to content

Instantly share code, notes, and snippets.

@ali-sheiba
Last active March 14, 2020 11:22
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ali-sheiba/4081df7701f8820bb51b2b9ee8e55192 to your computer and use it in GitHub Desktop.
Save ali-sheiba/4081df7701f8820bb51b2b9ee8e55192 to your computer and use it in GitHub Desktop.
Setup Ubuntu Server with Ngnix + MySQL + Redis + Git + RVM + Ruby 2.5.0 + Ruby On Rails
#!/bin/sh
# ngix + required packages
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install curl git-core nginx build-essential tcl8.5 -y
# Install ImageMagick
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev libmagic-dev
# mysql
# sudo apt-get install libmysqlclient-dev mysql-server
# PG
sudo apt-get install libpq-dev postgresql postgresql-contrib
# redis
cd ~
wget http://download.redis.io/releases/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install
cd utils
sudo ./install_server.sh
# rvm
cd ~
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm requirements
rvm install 2.5.0
rvm use 2.5.0 --default
# Auto update rvm
echo rvm_autoupdate_flag=2 >> ~/.rvmrc
# rails
gem install rails -V --no-ri --no-rdoc
gem install bundler -V --no-ri --no-rdoc
gem install mysql2 -v '0.4.3'
gem install pg -v '0.19.0'
# generate ssh key
# ssh-keygen -t rsa
# cat ~/.ssh/id_rsa.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment