Controlling Services (systemctl)
Concept & Overview
Imagine hosting a website on your computer, but visitors get a "site cannot be reached" error because the background web server program isn't running. In Linux, background processes that start automatically and run in the background (like databases, firewalls, or web servers) are called services, and we manage them using systemctl.
- The systemctl status command checks if a service is active or stopped.
- Since starting or stopping a service affects all users and the system's security, you must use sudo to run commands like sudo systemctl start or sudo systemctl stop .
apache2 is currently stopped. Start it by running sudo systemctl start apache2, and verify it is running with systemctl status apache2.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
systemctl status apache2 | Check status of apache2 web service |
sudo systemctl start apache2 | Start the apache2 web service |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Start the "apache2" web service
- ○Check the status of "apache2"
Ready to complete Quest 89?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.