2019-06-20 15:26:06 +00:00
|
|
|
# Linux 201: Web Server Setup
|
|
|
|
|
2019-06-20 15:45:01 +00:00
|
|
|
## Introduction
|
|
|
|
|
|
|
|
- Goals
|
2019-06-20 15:54:09 +00:00
|
|
|
- Understand the process of setting up a web server
|
|
|
|
- Understand why security is important when setting a web server.
|
2019-06-20 15:45:01 +00:00
|
|
|
- Setup a basic web server to serve static files
|
2019-06-20 15:54:09 +00:00
|
|
|
|
2019-06-20 15:45:01 +00:00
|
|
|
- Non-goals - links to useful tutorials will be provided at the end of this lab sheet
|
|
|
|
- Setting up HTTPS - This requires a domain name
|
2019-06-20 15:54:09 +00:00
|
|
|
-
|
2019-06-20 15:45:01 +00:00
|
|
|
|
2019-06-20 15:26:06 +00:00
|
|
|
## Things to mention in the slide deck
|
2019-06-20 15:54:09 +00:00
|
|
|
-
|
2019-06-20 15:26:06 +00:00
|
|
|
- Apache vs Nginx
|
|
|
|
- Thread-based vs event-based servers
|
|
|
|
|
|
|
|
## Basic Security
|
|
|
|
- Creating a non-root account
|
2019-06-20 16:01:37 +00:00
|
|
|
- `sudo` permissions
|
|
|
|
- The Linux security model: Knowing why you're typing your password
|
2019-06-20 15:26:06 +00:00
|
|
|
- SSH
|
|
|
|
- Disable root login
|
|
|
|
- SSH Keys
|
|
|
|
- Firewall
|
|
|
|
- `ufw`
|
|
|
|
- https://starbeamrainbowlabs.com/blog/article.php?article=posts/047-Linux-Security-Part-1.html
|
|
|
|
|
|
|
|
## Installing a Web Server
|
2019-08-15 15:27:56 +00:00
|
|
|
With our server secured, we can now install our web server. In this tutorial, we'll be using _[Nginx](https://nginx.org)_.
|
|
|
|
|
2019-06-20 15:45:01 +00:00
|
|
|
- systemd services
|
|
|
|
- Nginx is a service
|
2019-06-20 15:54:09 +00:00
|
|
|
-
|
2019-06-20 15:26:06 +00:00
|
|
|
- Installing Nginx
|
|
|
|
- `sudo apt install nginx`
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
- `/etc/nginx/nginx.conf`
|
2019-06-20 16:02:03 +00:00
|
|
|
- `/etc/nginx/sites-available/*`
|
|
|
|
- `/etc/nginx/sites-enabled/*`
|
2019-06-20 15:26:06 +00:00
|
|
|
|
|
|
|
## References and Further Reading
|
|
|
|
- [Nginx](https://www.nginx.com/)
|
|
|
|
- [How to Secure a Linux Server](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/)
|
|
|
|
- [SSL Certificates](https://letsencrypt.org)
|
|
|
|
- [Freeside Discord Invite](http://discord.freeside.co.uk)
|