Publishing a website on Linux
Starting from an empty server, you put a website live: the web server, file permissions, the host name, the logs and your first HTTPS.
Level 201 · 15 lessons · 12 practice labs
Lessons
The first site
- How a page is served: request, server, file
- Installing a web server and seeing it work
- The document root and placing the files
- Short task: put the company's landing page online
Setting it up properly
- File ownership: who writes and what the server reads
- The site config file and testing it
- Reaching the site by name: hosts and server_name
- Error pages and turning off directory listing
- Keeping hidden files off the web: .git, backups and robots.txt
- Short task: serve two separate sites from the same server
Running it
- Reading the access and error logs
- First HTTPS: a certificate and the redirect
- Updating the site: backups and a way back
- A small script that checks the site is up
- Capstone: launch a new project's site from scratch, safely
Practice labs
- Publish your first page with Nginx: Replace the default page with your own HTML file and verify with curl that it is served.
- Open a site returning 403 by fixing permissions: Find the directory and file permissions the web server cannot read and fix them with least privilege.
- Solve a port clash keeping the web server down: Find the other process holding port 80, also fix the typo flagged by the config test and start the server.
- Set up a tidy directory and ownership for a site: Move the site to its own root directory, giving the deploy user write access and the web server read-only access.
- Host two sites on one server: Define separate config files and logs for two domains and return an empty response for unknown host names.
- Turn on HTTPS and fix a redirect loop: Install the lab certificate, redirect HTTP to HTTPS and fix the endless loop between www and the bare domain.
- Test a change and reload: Change the config, run the syntax test and reload without stopping the service.
- Set up custom error pages and a maintenance mode: Define custom pages for 404 and 500 and add a maintenance mode switched by a file's presence that returns 503.
- Rotate site logs and rescue a full disk: Free space on a site whose log filled the disk, write the rotation rule and verify the server writes to the new file afterwards.
- Protect an admin directory with a password: Protect the admin path with basic authentication and show the password file sits outside the web root.
- Open a path to the office network only: Allow the status page from the office network only, return 403 to others and test from two sources.
- Find and close files exposed in the web root: Find backup, version control and environment files in the web root, move them or block access and verify with requests.
About this course
Starting from an empty server, you put a website live: the web server, file permissions, the host name, the logs and your first HTTPS.
What you will learn
- The first site
- Setting it up properly
- Running it
Prerequisites
Finishing the level 101 courses of the same path, or knowing those topics, is enough.
Lab environment
Lessons run in your own Kali Linux terminal that opens in the browser. Nothing to install; the lab starts clean in every lesson.
Frequently asked questions
- Is this course right for my level?
- The course is at level 201; it assumes you know the topics of the lower-level courses.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.