LFCE 159 ๐ง LFCE Practice Scenarios โ Services
The Service Configuration domain of the LFCE exam carries a weight of 17% and lists ten competencies: HTTP, time synchronization, network logging, DHCP, SMTP, HTTP proxy, host-based and user-based security, centralized authentication, PXE boot, and authoritative DNS . The exam is performance-based, which means the candidate is given a live terminal and a set of tasks to configure, start, and verify each service. The scenarios below are written as tasks rather than as quizzes, because the exam evaluates the system’s state, not the candidate’s recall.
Key point: A service that is installed but not enabled, not started, and not verified is a service that has not been configured. The exam checks systemctl is-enabled, systemctl status, and a functional testโa curl, a dig, or a chronyc queryโfor every service task.
Why the scenarios are task-based
The integration problem. A service configuration is rarely a single file edit. The HTTP server needs the firewall port open, the correct SELinux context on the document root, and the service enabled at boot. The DNS server needs the zone file syntax checked with named-checkconf and named-checkzone before the service is restarted . The exam rewards the candidate who works in layers: install, configure, enable, start, test .
The verification problem. A command that exits with zero does not prove the service works. A systemctl start httpd that succeeds does not prove that the virtual host is serving the correct content. The verification step is a separate task: curl http://localhost, dig @localhost example.com, chronyc tracking, or echo "EHLO test" | nc localhost 25. The exam scenario is complete only when the verification passes.
The persistence problem. A service that is started but not enabled will not survive a reboot. The exam tasks often specify “ensure the service starts at boot” or “make the configuration persistent.” The systemctl enable command and the firewall-cmd --permanent flag are the mechanisms that satisfy the persistence requirement .
a. Implement and configure an HTTP server
The HTTP server scenario is the most common service task. The candidate is given a document root, a hostname, and a port, and must configure the server to serve the content at that address.
On RHEL-family systems, the server is httpd; on Debian-family systems, it is apache2 or nginx. The configuration directory is /etc/httpd/conf.d/ or /etc/apache2/sites-available/. A virtual host block defines the ServerName, the DocumentRoot, and the access rules.
# /etc/httpd/conf.d/example.conf
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/example
<Directory /var/www/example>
Require all granted
</Directory>
</VirtualHost>
The apachectl configtest command validates the syntax before the restart . The semanage fcontext and restorecon commands set the SELinux context on the document root, which is the most common reason a correctly configured server returns a 403. The firewall must permit port 80 and 443 with firewall-cmd --permanent --add-service=http --add-service=https.
The verification is curl -H "Host: example.com" http://localhost/, which sends the Host header and confirms that the virtual host is serving the correct content.
b. Implement and configure time synchronization
The time synchronization server is chrony on modern distributions. The configuration file is /etc/chrony.conf. The server or pool directive points to the upstream time source. The allow directive permits the local network to query the server.
# /etc/chrony.conf
pool 2.pool.ntp.org iburst
allow 192.168.1.0/24
The chronyc tracking command shows the current offset and the synchronization status. The chronyc sources command shows the upstream servers and their reachability. The timedatectl command shows the system clock and the NTP synchronization status.
The scenario may ask the candidate to configure the system as a Stratum 1 server, which requires a local reference clock or the local stratum 1 directive in chrony.conf. The verification is a chronyc tracking on the server and a chronyc sources on a client that points to the server.
c. Implement and configure network logging
The network logging server is rsyslog. The configuration file is /etc/rsyslog.conf or a drop-in file in /etc/rsyslog.d/. The module(load="imtcp") and input(type="imtcp" port="514") directives enable the TCP listener. The template and action directives route the incoming logs to a per-host directory.
The verification is a logger -t test "message" on a client that sends to the server, and a tail /var/log/remote/<client>/test.log on the server. The firewall must permit port 514/tcp. The rsyslogd -N1 command validates the configuration syntax before the restart.
d. Configure a DHCP server
The DHCP server is dhcpd on RHEL-family systems and isc-dhcp-server on Debian-family systems. The configuration file is /etc/dhcp/dhcpd.conf. A subnet declaration defines the range, the gateway, the DNS server, and the lease time.
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.10;
}
The dhcpd -t command validates the configuration. The service must be enabled and started. The firewall must permit port 67/udp. The verification is a client that obtains a lease, or a dhcping command against the server.
e. Implement and configure an SMTP service
The SMTP service is postfix on most distributions. The configuration file is /etc/postfix/main.cf. The myhostname, mydomain, and myorigin directives set the identity. The inet_interfaces directive controls the listening interfaces. The mynetworks directive controls which clients can relay.
The postfix check command validates the configuration. The systemctl reload postfix command applies the changes. The firewall must permit port 25/tcp. The verification is echo "EHLO test" | nc localhost 25, which should return the SMTP banner and the supported extensions.
f. Implement and configure the HTTP proxy server
The HTTP proxy server is squid. The configuration file is /etc/squid/squid.conf. The http_port directive sets the listening port (default 3128). The acl and http_access directives control which clients are allowed to use the proxy.
http_port 3128
acl localnet src 192.168.1.0/24
http_access allow localnet
http_access deny all
The squid -k parse command validates the configuration. The firewall must permit port 3128/tcp. The verification is a curl -x http://localhost:3128 http://example.com, which should return the page through the proxy.
g. Configure host-based and user-based security
The host-based security scenario is the firewall and the TCP wrappers. The firewall-cmd commands add the services and ports permanently. The /etc/hosts.allow and /etc/hosts.deny files control the TCP wrappers access. The user-based security scenario is the PAM configuration and the SSH AllowUsers directive.
The verification is a curl from an allowed host and a curl from a denied host, or an ssh login as an allowed user and a denied user.
h. Implement and configure a centralized authentication server
The centralized authentication server is sssd with an LDAP or Kerberos backend, or a freeipa server. The client configuration is covered in Domain 3. The server-side scenario is the LDAP directory with the 389-ds or openldap package, the base DN, and the user entries. The verification is a ldapsearch against the server and a getent passwd on the client.
i. Implement and configure a PXE boot server
The PXE boot server combines a DHCP server, a TFTP server, and a boot image. The DHCP server must include the next-server and filename options. The TFTP server serves the pxelinux.0 or grubx64.efi bootloader. The boot image is the kernel and the initrd.
# dhcpd.conf
next-server 192.168.1.10;
filename "pxelinux.0";
The verification is a client that boots from the network and receives the bootloader. The firewall must permit TFTP (69/udp) and DHCP (67/udp).
j. Implement and configure an authoritative DNS server
The authoritative DNS server is bind (named). The configuration file is /etc/named.conf on RHEL-family systems and /etc/bind/named.conf on Debian-family systems. A zone block defines the zone name, the type (master), and the file path. The zone file contains the SOA, NS, A, and PTR records .
zone "example.com" {
type master;
file "/var/named/example.com.zone";
};
The named-checkconf command validates the main configuration. The named-checkzone example.com /var/named/example.com.zone command validates the zone file. The firewall must permit port 53/tcp and 53/udp. The verification is a dig @localhost example.com that returns the A record.
Complete Example Session
# ============================================
# PART 1: HTTP SERVER
# ============================================
dnf install -y httpd
systemctl enable --now httpd
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
curl -H "Host: example.com" http://localhost/
# ============================================
# PART 2: TIME SYNCHRONIZATION
# ============================================
dnf install -y chrony
systemctl enable --now chronyd
chronyc tracking
chronyc sources
# ============================================
# PART 3: NETWORK LOGGING
# ============================================
dnf install -y rsyslog
# Add imtcp input to /etc/rsyslog.d/10-remote.conf
rsyslogd -N1
systemctl restart rsyslog
# ============================================
# PART 4: DHCP SERVER
# ============================================
dnf install -y dhcp-server
# Edit /etc/dhcp/dhcpd.conf
dhcpd -t
systemctl enable --now dhcpd
# ============================================
# PART 5: SMTP SERVICE
# ============================================
dnf install -y postfix
postfix check
systemctl enable --now postfix
echo "EHLO test" | nc localhost 25
# ============================================
# PART 6: HTTP PROXY
# ============================================
dnf install -y squid
squid -k parse
systemctl enable --now squid
curl -x http://localhost:3128 http://example.com
# ============================================
# PART 7: DNS SERVER
# ============================================
dnf install -y bind
named-checkconf
named-checkzone example.com /var/named/example.com.zone
systemctl enable --now named
dig @localhost example.com
# ============================================
# PART 8: PXE BOOT
# ============================================
dnf install -y tftp-server syslinux
# Configure dhcpd next-server and filename
systemctl enable --now tftp.socket
# ============================================
# PART 9: SECURITY
# ============================================
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
# Configure /etc/hosts.allow and /etc/hosts.deny
# ============================================
# PART 10: VERIFICATION
# ============================================
systemctl is-enabled httpd chronyd rsyslog dhcpd postfix squid named
The ten parts covered the HTTP server, time synchronization, network logging, DHCP, SMTP, HTTP proxy, DNS, PXE boot, security, and verification.
Quick Reference
Domain 6 competencies
| Competency | Service | Config file |
|---|---|---|
| HTTP server | httpd / nginx | /etc/httpd/conf.d/ |
| Time sync | chronyd | /etc/chrony.conf |
| Network logging | rsyslog | /etc/rsyslog.d/ |
| DHCP | dhcpd | /etc/dhcp/dhcpd.conf |
| SMTP | postfix | /etc/postfix/main.cf |
| HTTP proxy | squid | /etc/squid/squid.conf |
| Centralized auth | sssd / freeipa | /etc/sssd/sssd.conf |
| PXE boot | tftp-server + dhcpd | /var/lib/tftpboot/ |
| Authoritative DNS | named (BIND) | /etc/named.conf |
Validation commands
| Service | Command |
|---|---|
| Apache | apachectl configtest |
| Nginx | nginx -t |
| BIND | named-checkconf, named-checkzone |
| Postfix | postfix check |
| Squid | squid -k parse |
| rsyslog | rsyslogd -N1 |
| DHCP | dhcpd -t |
Verification commands
| Service | Command |
|---|---|
| HTTP | curl -H "Host: ..." http://localhost/ |
| Time | chronyc tracking |
| Logging | tail /var/log/remote/<client>/... |
| SMTP | echo "EHLO test" | nc localhost 25 |
| Proxy | curl -x http://localhost:3128 ... |
| DNS | dig @localhost example.com |
Persistence commands
| Task | Command |
|---|---|
| Enable at boot | systemctl enable <service> |
| Firewall permanent | firewall-cmd --permanent --add-service=... |
| SELinux context | semanage fcontext, restorecon |
Best Practices
โ Do This:
# Validate the configuration before restarting
apachectl configtest # โ
# Enable the service at boot
systemctl enable --now httpd # โ
# Open the firewall port permanently
firewall-cmd --permanent --add-service=http # โ
# Verify with a functional test
curl -H "Host: example.com" http://localhost/ # โ
โ Don’t Do This:
# Start the service without enabling it
systemctl start httpd # โ
# Restart without validating the configuration
systemctl restart httpd # โ (may fail)
# Forget the SELinux context on the document root
# 403 Forbidden despite correct Apache config # โ
# Assume the firewall change is permanent
firewall-cmd --add-service=http # โ (runtime only)
Common Pitfalls
| Pitfall | Why It Happens | Fix |
|---|---|---|
| Apache returns 403 | SELinux context on document root | semanage fcontext, restorecon |
| Service not reachable | Firewall blocks the port | firewall-cmd --permanent --add-service |
| Service not starting | Configuration syntax error | Validate with the service’s check command |
| DNS query fails | Zone file syntax error | named-checkzone |
| DHCP client no lease | Wrong subnet or range | Check dhcpd.conf and the interface |
| Proxy not working | Client not in the ACL | Add the client to the acl and http_access |
Real-World Examples
1. HTTP virtual host
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/example
</VirtualHost>
2. Chrony server
pool 2.pool.ntp.org iburst
allow 192.168.1.0/24
3. Rsyslog TCP input
module(load="imtcp")
input(type="imtcp" port="514")
4. DHCP subnet
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
}
5. Postfix check
postfix check
6. Squid ACL
acl localnet src 192.168.1.0/24
http_access allow localnet
7. BIND zone
zone "example.com" {
type master;
file "/var/named/example.com.zone";
};
8. PXE DHCP options
next-server 192.168.1.10;
filename "pxelinux.0";
9. Firewall permanent
firewall-cmd --permanent --add-service=https
10. Verification
systemctl is-enabled httpd chronyd named
Visual
The service configuration flow
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ INSTALL โโโบ CONFIGURE โโโบ VALIDATE โโโบ ENABLE โโโบ START โ
โ โ โ
โ โผ โ
โ FIREWALL โโโบ SELINUX โโโบ VERIFY โ
โ โ
โ Each layer is separate. โ
โ A failure at any layer produces a broken service. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The DNS validation
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ named-checkconf โ
โ โโโ validates /etc/named.conf โ
โ โ
โ named-checkzone example.com zonefile โ
โ โโโ validates the zone file syntax โ
โ โ
โ Only then: systemctl restart named โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The HTTP verification
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ curl -H "Host: example.com" http://localhost/ โ
โ โ โ
โ โผ โ
โ The Host header selects the virtual host. โ
โ The response body confirms the content. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The persistence check
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ systemctl is-enabled httpd โ enabled โ
โ firewall-cmd --list-all โ http https present โ
โ reboot โโโบ curl http://localhost/ โโโบ content โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Summary
| Item | Value |
|---|---|
| Domain weight | 17% |
| Competencies | HTTP, time sync, logging, DHCP, SMTP, proxy, security, centralized auth, PXE, DNS |
| HTTP validation | apachectl configtest or nginx -t |
| DNS validation | named-checkconf, named-checkzone |
| Mail validation | postfix check |
| Proxy validation | squid -k parse |
| Persistence | systemctl enable |
| Firewall | firewall-cmd --permanent |
| Verification | curl, dig, chronyc, nc |
Key takeaways:
- The domain is task-based and integration-heavy. A service configuration is not a single file edit. It requires the package installation, the configuration file, the syntax validation, the service enablement, the firewall rule, and the SELinux context . The exam checks the complete chain.
- Validation before restart is mandatory.
apachectl configtest,named-checkconf,postfix check, andsquid -k parsecatch the syntax errors that would otherwise take the service offline. A restart without validation is a restart that may fail. - Persistence is a separate requirement.
systemctl enableandfirewall-cmd --permanentare the commands that make the configuration survive a reboot. A service that is started but not enabled is a service that will not be running after the next restart. - The verification is the proof. A
curlwith theHostheader, adigagainst the local resolver, achronyc trackingquery, and ancto the SMTP port are the tests that confirm the service works. The exam task is not complete until the test passes. - The DNS server requires two validation commands.
named-checkconfvalidates the main configuration, andnamed-checkzonevalidates the zone file. Both must pass before the restart .
Remember: The Service Configuration domain is the largest single-service domain in the exam. The ten competencies cover the services that a Linux engineer configures in production: web, time, logging, DHCP, mail, proxy, authentication, PXE, and DNS. The pattern is the same for each: install, configure, validate, enable, start, open the firewall, verify. Practice the pattern on a clean virtual machine, because the performance-based format rewards the candidate who can execute the sequence without hesitation.
Stop using slow, ad-bloated tool sites! ๐คฎ
๐ Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
โ
Finance (Mortgage, Interest, Inflation)
โ
Tech (Base64, JSON, Dev Suite, IP)
โ
Health (BMI, BMR, TDEE)
โ
Productivity (Timer, Workspace, QR)
โก๏ธ Fast & Private
๐ No data leaves your device
๐ 100% Free
๐ Use it now: https://tools.kandz.me
๐ Bookmark itโyouโll need it later!