Setting up EC2 instance
  • Add ssh keys to .ssh/autohorized_keys for standard user ubuntu
  • Install Ruby (see below)
  • Install and configure Nginx (see below)

Install Ruby

Ruby is installed under /usr/local/libwith each ruby version in it's own directory
Install dependencies:
1
sudo apt-get update
2
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs
Copied!
Add the the current user ubuntuto the staff group
1
sudo usermod -a -G staff ubuntu
Copied!
Now log out and log back in for new group to take effect.
Install the latest version of ruby-install
Installation instructions for version 0.6.1 is replicated here
1
wget -O ruby-install-0.6.1.tar.gz https://github.com/postmodern/ruby-install/archive/v0.6.1.tar.gz
2
tar -xzvf ruby-install-0.6.1.tar.gz
3
cd ruby-install-0.6.1/
4
sudo make install
Copied!

Installing ruby 2.4.0

We will use /usr/local/lib/ruby-2.4.0
Prepare the directory
1
sudo mkdir /usr/local/lib/ruby-2.4.0
2
sudo chgrp staff /usr/local/lib/ruby-2.4.0
3
sudo chmod 775 /usr/local/lib/ruby-2.4.0
Copied!
Install ruby
1
ruby-install --install-dir /usr/local/lib/ruby-2.4.0 ruby 2.4.0
Copied!
And finally install bundler
1
/usr/local/lib/ruby-2.4.0/bin/gem install bundler
Copied!

Install and configure Nginx

Install nginx
1
sudo apt install nginx
Copied!
Get the nginx configuration files and copy them in place
1
cd
2
git clone https://github.com/greaterthan/aws-deploy.git
3
sudo cp aws-deploy/cobudget /etc/nginx/sites-available/
4
sudo cp aws-deploy/cobudget_trace.conf /etc/nginx/conf.d/
5
cd /etc/nginx/sites-enabled
6
sudo rm default
7
sudo ln -s /etc/nginx/sites-available/cobudget cobudget
Copied!
Restart the nginx server
1
sudo systemctl restart nginx
Copied!

Install SSL certificates using certbot

Use the instructions from certbot
As the mail address for notifications, use [email protected]
Add HTTP2.0 capability by following these instructions.
Last modified 3yr ago