In this course you will learn:
- How to deploy applications on a Linux server on an IaaS platform (Microsoft Azure).
- How to deploy applications on a PaaS platform (Render).
In pursuit of this goal, you will learn:
- How to use the command line and version control.
- The basics of Unix system administration and cloud computing architectures.
- Good security practices related to system administration and web applications.
This course is a Media Engineering web development course taught at HEIG-VD.
- Legend
- What you will need
- Plan
- How to improve our basic deployment
- Our architecture so far
- More Practice
- Extra
- Frequently Asked Questions
- References
Parts of this guide are annotated with the following icons:
- π Slides or written documents pertaining to the various topics discussed during this course.
- π¨ An exercise aimed at practicing a topic discussed in class.
- π₯ This exercise is graded.
- π Solution(s) for an exercise.
- π₯ A video related to a subject.
- ποΈ The deployment architecture put in place during an exercise.
For you to succeed in this course, it is highly recommended that you read and complete all the content that is not labeled "extra".
- A Unix CLI
- Linux/macOS users can use their standard Terminal
- Windows users should install Git for Windows which includes Git Bash (or the WSL for more advanced users)
- Git
- macOS users should install the command-line tools
- Windows users should install Git for Windows
- Linux users on Debian/Ubuntu-based systems can install Git with the
sudo apt install git
command, or with their other distributions' package managers.
- A free GitHub account
- Google Chrome (recommended, any browser with developer tools will do)
- Firefox (optional, required for one network exercise)
- A free Render account
-
Introduction
-
Version control
-
Security
-
Basic deployment
- π Cloud computing
- π¨ Run your own virtual server on Microsoft Azure
- π Linux
- π Unix basics & administration
- π¨ Permissions
- π Unix processes
- π¨ Pipeline
- π Unix networking
- π¨ Transmission Control Protocol (TCP)
- π¨ Deploy a PHP application with SFTP
- π How to improve our basic deployment
-
Advanced deployment
- π¨ Deploy a PHP application with Git
- π Twelve-factor app
- π Unix environment variables
- π¨ Configure a PHP application through environment variables
- π Linux process management
- π¨ Manage a PHP application with systemd as a Process Manager
- π Domain Name System (DNS)
- π¨ Configure a domain name
- π Reverse proxying
- π¨ Deploy a static site with nginx
- π¨ Deploy a PHP application with nginx and the FastCGI process manager
- π TLS/SSL certificates
- π¨ Provision a Let's Encrypt TLS certificate with Certbot
- π¨ Deploy a multi-component web application with nginx
- π¨ Horizontally scale a web application with nginx as a load balancer
-
Automated deployment
-
Graded deployment exercise
- π₯ π¨ Not yet available
-
Managed deployments
The basic SFTP deployment of the PHP TodoList has several flaws which we will fix during the rest of the course:
- Transfering files manually through SFTP is slow and error-prone. We will use Git to reliably transfer files from our central codebase and easily keep our deployment up-to-date over time.
- Hardcoding configuration is a bad practice. We will use environment variables so that our application can be dynamically configured and deployed in any environment without changing its source code.
- Starting our application manually is not suitable for a production deployment. We will use a process manager to manage the lifecycle of our application: starting it automatically when the server boots, and restarting it automatically if it crashes.
- Accessing a web application through an IP address is not user-friendly. We will obtain a domain and configure its DNS zone file so that our application is accessible with a human-readable domain name.
- Using a non-standard port is not user-friendly either. We will run the application on port 80 or 443 so that the end user does not have to specify a port in the browser's address bar.
- Running our application server directly on port 80 or 443 will cause a problem: only one process can listen on a given port at the same time. We need another tool to support multiple production deployments on the same server. That will be the job of a reverse proxy like Apache or nginx.
- Our application is not secure as indicated by the browser, because it is served over HTTP and not HTTPS. We will obtain a TLS/SSL certificate signed by a trusted certificate authority so that our application can be served over HTTPS and recognized as secure by browsers.
- The PHP Development Server is not meant to deploy applications in production environments. We will use the FastCGI Process Manager to perform a production-grade deployment, making our application more resilient and able to serve more clients concurrently.
This is a simplified architecture of the main running processes and communication flow at the end of all the exercises we have done so far (up to π¨ Deploy a PHP application with nginx and the FastCGI process manager at this time):
π Note that unless you stopped it yourself, the systemd service you set up during the exercise π¨ Manage a PHP application with systemd as a Process Manager is still running, and the PHP Todolist is still accessible on port 3000 as well as through nginx on port 80.
Complete deployments
- π¨ Deploy Flood It, a Spring Boot (Java) & Angular application with a PostgreSQL database
- π¨ Deploy Minesweeper, a Phoenix (Elixir) & Alpine.js application with a PostgreSQL database
- π¨ Deploy RPS, a Node.js & Svelte web application with a PostgreSQL database
- π¨ π¨ Deploy WOPR, a Sinatra & Svelte application with a Redis database
- π¨ Deploy One Chat Room, an Express (Node.js) web application with a MongoDB database
- π¨ Deploy Big Browser, a Nest.js (Node.js) application with a Redis database
42
Read the command line cheatsheet
Read the system administration cheatsheet
Don't use something that is hard to remember. You're better off using a passphrase (here's a French version).
These are the main references used throughout this course. More detailed and additional links to various online articles and documentation can be found at the end of each subject.
- The Linux Documentation Project
- Building the Future of the Command Line
- SSH, The Secure Shell: The Definitive Guide - Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes
- The Git Book
- Open Web Application Security Project
- Ops School Curriculum
- The Internet Explained From First Principles
- The Twelve-Factor App
- Systemd Manual
- nginx documentation
- Render Documentation
Wikipedia is also often referenced, namely these and related articles: