Skip to content

Instantly share code, notes, and snippets.

@basmoura
Last active July 20, 2017 14:28
Show Gist options
  • Save basmoura/9855555 to your computer and use it in GitHub Desktop.
Save basmoura/9855555 to your computer and use it in GitHub Desktop.
VPS Config
https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04
sudo apt-get update
curl -L get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvmsudo /usr/bin/apt-get install build-essential nodejs openssl libcurl4-openssl-dev libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
rvm install 2.1.0
rvm use 2.1.0 --default
rvm requirements
gem install rails --no-ri --no-rdoc
sudo apt-get install postgresql postgresql-server-dev-9.3
sudo -u postgres psql
create user username with password 'password';
alter role username superuser createrole createdb replication; #superuser
create user username with password 'password';
create database projectname_production owner username;
Passenger + Nginx
https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/aws/nginx/oss/xenial/install_passenger.html
https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-nginx-on-ubuntu-14-04
wget -O init-deb.sh http://library.linode.com/assets/660-init-deb.sh
wget -O init-deb.sh http://www.linode.com/docs/assets/660-init-deb.sh
sudo mv init-deb.sh /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx
sudo /usr/sbin/update-rc.d -f nginx defaults
server {
listen 80;
server_name example.com;
passenger_enabled on;
root /var/www/my_awesome_rails_app/public;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment