Verifying the status of a service
I'll be using Alma Linux for this first demo, for a reason that will become clear in just a moment. First, let's install the Apache web server by doing the following:
sudo dnf install httpd
Before you can start using Apache, you'll want to know whether it's enabled, so that it will automatically start when you reboot the machine. You'll also want to know whether it's active, which just means that it's running.
To see whether it's enabled, do the following:
[donnie@localhost ~]$ systemctl is-enabled httpd [sudo] password for donnie: disabled [donnie@localhost ~]$
Here, you see why I'm using a RHEL-type distro for this. When you install a service on any RHEL-type machine, it's normally disabled
by default. When you install a service on Ubuntu, it's normally enabled
by default. So, by doing this on Alma Linux, I can give you more to look at.
Next, let's see whether Apache is...