Services and Self-Hosting
Objective: Install, configure, and manage real services on your machine.
A computer that just sits there with a desktop is a paperweight. IT professionals make machines do things: serve websites, handle DNS, share files, host applications. You're going to turn your machine into a working server.
A service is a program that runs in the background and does a job. systemd manages them all.
-
Nginx : Web server. Serve HTML pages. Configure virtual hosts. Change ports.
-
Pi-hole : Network-level DNS server. Block ad domains. Understand DNS traffic.
-
Samba : File server. Share directories across your local network.
-
systemd : The init system and service manager. start vs. enable is the critical distinction.
systemctl start [service] Start a service right now systemctl stop [service] Stop a running service systemctl restart [service] Restart a service systemctl enable [service] Auto-start on boot systemctl disable [service] Remove from boot sequence systemctl status [service] Current status and recent log output journalctl -u [service] -f Follow live logs for a service journalctl -u [service] --since '1 hour ago' Recent log history - 1
Install Nginx. Configure it to serve an HTML page you write yourself. Access it from your browser at http://localhost. Change the port to 8080 and access it there.
- 2
Install Pi-hole. Configure your machine to use it as its DNS server. Block an ad domain and verify it's blocked.
- 3
Install and configure Samba. Create a shared folder accessible from another device on your network.
- 4
Use systemctl to start, stop, restart, enable, and check the status of each service. Understand the difference between start and enable.
- 5
Find the log files for Nginx and Pi-hole. Read them. Identify what a normal log entry looks like vs. an error.