Start, Stop, and Check the Status of Network Services

Red Hat Enterprise LinuxBeginner
Practice Now

Introduction

In this challenge, you will learn how to start, stop, and check the status of network services on a Linux system. This is an essential skill for system administrators who need to manage and maintain network services running on their servers.

Manage Network Services

In this challenge, you will learn how to start, stop, and check the status of network services on a Linux system.

Tasks

  • Start the httpd (Apache HTTP Server) service
  • Check the status of the httpd service

Requirements

  • All operations should be performed as the labex user
  • The default working directory is ~/project
  • Use the appropriate systemd commands to manage the httpd service
  • Use sudo to run the commands as the labex user

Example

After starting the httpd service, you should see the following output when checking the service status:

$ 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 Mon 2023-04-17 12:34:56 UTC; 1min 23s 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

Summary

In this challenge, you learned how to start, stop, and check the status of the httpd (Apache HTTP Server) service using systemd commands. This is an essential skill for system administrators who need to manage and maintain network services running on their Linux servers. You practiced using the systemctl command to control the httpd service, and you also learned how to write verification scripts to ensure that the service is in the expected state.

✨ Check Solution and Practice