Email the Author
You can use this page to email Paul C about DIY DevOps.
About the Book
This tutorial is for anyone or team who needs to automate the deployment and maintenance of static websites (html/css/javascript) on a Virtual Private Server instance at digitalocean.com. If you are capable of following tutorials to create a very basic HTML file, you should have no problem following this tutorial.
We will set up websites on a digitalocean.com's droplet (aka Virtual Private Server).
When I started self-hosting websites on VPS, I realized there was a lot of repetitive work involved in deploying content. Even fixing a small typo involved way too many manual steps. To fix a simple typo, I had to fix the typo on local computer > FTP or scp files up > ssh into web server > copy uploadeded .html file into place > reapply permission. Simply too many manual steps for fixing a typo. I wanted to automate the process so that all of the steps can be done with least amount of manual work. As I was teaching myself how to automate it, I had to turn to many different tutorials/videos/documentations. Unfortunately many tutorials did not exactly fit into my scenarios. I slowly taught myself how to setup/run/automate self-hosted website and slowly became a self-taught DIY DevOps engineer. Obviously a DevOps engineer has many roles, but one important role is automating website content deployment.
Here is a short list of tasks we will complete in this tutorial.
- Buy a domain name at namecheap.com.
- Create a SSH key pair on local macOS.
- Upload SSH public key to digitalocean.com.
- Start a new VPS at digitalocean. We will nickname the new VPS as dserver01.
- Rebuild the new VPS, dserver01.
- Install Apache webserver.
- Sign up with cloudflare.com.
- Transfer name server from namecheap.com to cloudflare.com.
- Configure dserver01 with a shell script.
- Disable ssh login by root user.
- Set up 3 websites on Apache.
- Install nginx.
- Configure nginx as a reverse proxy, sitting between internet and Apache web server.
- Install LetsEncrypt.
- Set up .well-known in nginx.
- Get SSL certificates
- Set up nginx to use SSL certificates. Our webserver now serves content encrypted by SSL.
- Configure Apache and nginx to log with real IP of visitors.
- Deploy sample HTML5 website using a HTML/CSS/JS template.
- Using shell script to automate code deployment.
- Using Git
Following topics will be covered in future updates.
- Using Jenkins
- Script to automate configuring apache/nginx to add new websites
About the Author
DIY DevOps Engineer