Introduction
In this challenge, you will learn how to start, stop, and configure services to start automatically at system boot. This is an essential skill for system administrators to manage services effectively in a Linux environment.
In this challenge, you will learn how to start, stop, and configure services to start automatically at system boot. This is an essential skill for system administrators to manage services effectively in a Linux environment.
httpd
servicehttpd
servicelabex
userhttpd
serviceAfter starting the httpd
service, you should see the following output when running systemctl status httpd
:
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2023-04-12 10:00:00 UTC; 10s ago
Main PID: 12345 (httpd)
Status: "Running, listening on: port 80"
CGroup: /system.slice/httpd.service
├─12345 /usr/sbin/httpd -DFOREGROUND
├─12346 /usr/sbin/httpd -DFOREGROUND
└─12347 /usr/sbin/httpd -DFOREGROUND
And after stopping the httpd
service, you should see the following output when running systemctl status httpd
:
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: inactive (dead) since Wed 2023-04-12 10:00:30 UTC; 10s ago
Main PID: 12345 (code=exited, status=0/SUCCESS)
httpd
service to start automatically at system boothttpd
service starts automatically after a system rebootlabex
userhttpd
service to start automatically at bootAfter enabling the httpd
service to start automatically at boot, you should see the following output when running systemctl status httpd
:
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-04-12 10:00:00 UTC; 10s ago
Main PID: 12345 (httpd)
Status: "Running, listening on: port 80"
CGroup: /system.slice/httpd.service
├─12345 /usr/sbin/httpd -DFOREGROUND
├─12346 /usr/sbin/httpd -DFOREGROUND
└─12347 /usr/sbin/httpd -DFOREGROUND
In this challenge, you learned how to start, stop, and configure services to start automatically at system boot. You practiced using systemd commands to manage the httpd
service, which is an essential skill for system administrators. By completing this challenge, you have demonstrated your ability to deploy, configure, and maintain systems by managing services effectively.
If you need to set up the initial environment for this challenge, you can use the following setup.sh
script:
#!/bin/bash
## Install the httpd package
sudo yum install -y httpd
This script will install the httpd
package, which is required for this challenge. You can run the script as the labex
user to set up the initial environment.