So in this lab, you are going to make sure that the HTTPD
service is automatically started.
And also, you edit the configuration
that after a failure, it will automatically restart again.
So let's start by using dnf install minus y HTTPD,
because on this machine, it hasn't yet been installed.
And then we can use systemctl enable minus minus now HTTPD.
And that should be doing it, as you can see.
So to verify systemctl status on HTTPD.
Now we need to make sure that it is automatically
restarted after it fails.
So how do we do that?
Well, I would suggest you use systemctl cat sshd.service,
because there we can see the exact parameters that we need.
So restart is on failure, and restart sec is 42 seconds.
Now, if I would use systemctl edit on HTTPD,
I can put a service section on the top of the editor,
because this is where we put in the modifications.
And then I can paste what we just pasted.
Now, one little detail.
It needs to be restarted after one minute,
and one minute is 60 seconds.
So let's make it restart sec is 60 seconds.
And then in this editor, we can use Control-X to save it
and to apply, and everything is OK.
Next, to ensure that the change was read correctly,
systemctl daemon reload means that systemd
is going to reload all of its configuration.
And then you can use killall on HTTPD.
Let's do that killall minus sick kill
to send it the sick kill signal.
And then we should verify using systemctl status on HTTPD,
where we can see that it is activating
auto-restart six seconds ago.
So 54 more seconds of patience, and then it will be back.