Red Hat Certified System Administrator RHCSA · Free Practice Question Medium

Question 14

Create a Bash script that configures the Apache web server (httpd) to start automatically upon system boot in Red Hat Enterprise Linux 9. Your script should ensure that Apache is properly enabled to initiate during the boot process.

Show model answer

In RHEL 9, use the systemctl command to enable Apache to start at boot. The script should be as follows:

This script first checks if Apache (httpd) is installed. If installed, it uses systemctl enable to configure Apache to start automatically at boot. Optionally, it can also start Apache immediately.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need