/server-setup

Random instructions to get Linux servers working (Debian 9 and WSL Ubuntu)

Getting Setup on Debian 9

This guide is a checklist of all the things that need to be done to configure a server on Debian 9.

Create a Sudo User

Linuxize - create sudo user

Auth with SSH

Digital Ocean - how to set up SSH Keys

  • create SSH keys by running ssh-keygen on client machine (or use the ones that I already have)
  • copy public key (cat ~/.ssh/id_rsa.pub) to ./~ssh/authorized_keys file on the server

^^ That article does not go over how to add SSH keys to Git, so...

  • run ssh-keygen on the server and copy the pub key (cat ~/.ssh/id_rsa.pub) over to GitHub

Misc Getting Stated Tasks

Linode - Getting started

  • run updates (sudo apt-get update && sudo apt-get upgrade - pretty simple)
  • set hostname
  • update hosts file
  • set timezone

Secure the Server

Linode - How to Secure Your Server

  • disallow root login

Digital Ocean - Add a firewall

  • configure a firewall with UFW (Steps located here)
    • be sure to remember to both activate the firewall and allow port 22 SSH

Install Nginx Server

Digital Ocean - Setting up Nginx with server blocks

Getting React-Router working with Nginx

See here for config fix

Install SSL and redirect to https

Digital Ocean - Secure Nginx w/ Let's Encrpyt

This will create a cron job in /etc/cron.d/certbot.

Replace the existing cron job with this script

Setup up a Mail Server with a Gmail Relay

Linode - Guide here - this will allow for email to be sent from your personal Gmail account

Please note: You'll also need to install sudo apt-get install mailutils

Misc Tasks

Possble Issues

These are things that I ran into that had to be solved in the past

Postfix main.cf permission denied

Write permissions inside of public_html

domain.com not working in URL bar

Also when in doubt, try running sudo

Happy configuring!