Day 14 – Mastering systemd with Apache HTTPD

🧰 On Day 14, I focused on systemd, the modern service manager for Linux systems. I learned how to control and inspect services—using httpd (Apache Web Server) as my example.


🔧 Activities Summary

📦 Step 1: Install Apache HTTPD

yum install httpd -y

🚦 Step 2: Start, Stop, and Check Service Status

systemctl status httpd     # Check current status
systemctl start httpd      # Start the service
systemctl restart httpd    # Restart the service
systemctl reload httpd     # Reload config without restarting

💡 systemctl reload is useful when you change Apache config files (like /etc/httpd/conf/httpd.conf) and want to apply changes gracefully.

✅ Step 3: Enable and Check Service on Boot

systemctl enable httpd          # Enable service on boot
systemctl is-enabled httpd      # Check if it's enabled
systemctl is-active httpd       # Check if it's running

🔍 Enabling httpd creates a symbolic link:

cat /etc/systemd/system/multi-user.target.wants/httpd.service

You can trace how systemd manages targets (runlevels) and services from here.

🔐 Step 4: Inspect SSHD too

systemctl status sshd

Just to compare behavior of another essential system service.

🚀 What I Learned

✅ How to manage Linux services with systemctl
✅ Difference between start, restart, and reload
✅ Enabling/disabling services at boot using systemd
✅ How systemd uses unit files and targets for service control
✅ How to check symbolic links for enabled services


🧠 Real-World Value

As a DevOps engineer, you'll routinely work with systemd:

  • Automating service health checks

  • Enabling services after deployments

  • Writing custom service unit files (coming soon!)

  • Debugging system crashes related to services


🔮 What’s Next?

Day 15 will be about Killing Processes with ps, grep, awk & xargs

10
Subscribe to my newsletter

Read articles from Shaharyar Shakir directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shaharyar Shakir
Shaharyar Shakir