Skip to content

Instantly share code, notes, and snippets.

@jurassic-gists
Last active December 18, 2015 23:49
Show Gist options
  • Select an option

  • Save jurassic-gists/5864720 to your computer and use it in GitHub Desktop.

Select an option

Save jurassic-gists/5864720 to your computer and use it in GitHub Desktop.

Servers

Overview

  • Local Development Virtual Machine with similar or identical configuration to remote servers
  • Remote Servers
    • Production load balancer (Apache or Nginx)
      • Cluster for production
    • Staging load balancer (Apache or Nginx)
      • Cluster for staging
    • Database Server. Possibly load balancer

OS: Ubuntu 12.04

  • LAMP
  • RVM instructions
  • With Rails gem install rails --no-doc --no-ri
  • With Rails 3 gem install rails --version 3.2.13 --no-doc -no-ri
  • OpenSSH Public Key Setup
  • Git sudo apt-get -y install git
  • htop sudo apt-get -y install htop

VM Specific Issues

Cloning punchlist

  • Host Name:
  • sudo vim /etc/hostname (then change the hostname)
  • sudo vim /etc/hosts (Change hostname here too)
  • eth1: sudo vim /etc/network/interfaces (Change IP on eth1)
  • eth0: sudo rm /etc/udev/rule.d/70-persistent-net.rules && sudo shutdown -r now

Sudo without Password

Add the following line to your sudoers file username ALL=(ALL) NOPASSWD: ALL where username is the username in question.

You can add this line to the bottom of the normal sudoers file with the command sudo visudo or to a separate file located in /etc/sudoers.d/ with the command sudo visudo -f /etc/sudoers.d/<my file name>

Local Machine

MacOS / Linux

sshfs for text editing: sshfs -oworkaround=rename -o transform_symlinks -o follow_symlinks [your-remote-machine]: ~/[local-mount-point]

Vagrant + Puppet

LAMP Tutorial

Ruby / Rails setup

Capistrano extenstions

This will be used for deploying to multiple locations.

gem install capistrano --no-doc --no-ri

gem install capistrano-ext --no-doc --no-ri

Bundler

cap invoke COMMAND="gem install bundler --no-doc --no-ri"

Reference

http://guides.beanstalkapp.com/deployments/deploy-with-capistrano.html

Misc

Capistrano with RVM

Put set :default_shell, '/bin/bash -l' in your capfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment