| |

LFCE 159 ๐Ÿง LFCE Practice Scenarios โ€” Services

โฑ๏ธ Estimated read: 12 min | |

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

CompetencyServiceConfig file
HTTP serverhttpd / nginx/etc/httpd/conf.d/
Time syncchronyd/etc/chrony.conf
Network loggingrsyslog/etc/rsyslog.d/
DHCPdhcpd/etc/dhcp/dhcpd.conf
SMTPpostfix/etc/postfix/main.cf
HTTP proxysquid/etc/squid/squid.conf
Centralized authsssd / freeipa/etc/sssd/sssd.conf
PXE boottftp-server + dhcpd/var/lib/tftpboot/
Authoritative DNSnamed (BIND)/etc/named.conf

Validation commands

ServiceCommand
Apacheapachectl configtest
Nginxnginx -t
BINDnamed-checkconf, named-checkzone
Postfixpostfix check
Squidsquid -k parse
rsyslogrsyslogd -N1
DHCPdhcpd -t

Verification commands

ServiceCommand
HTTPcurl -H "Host: ..." http://localhost/
Timechronyc tracking
Loggingtail /var/log/remote/<client>/...
SMTPecho "EHLO test" | nc localhost 25
Proxycurl -x http://localhost:3128 ...
DNSdig @localhost example.com

Persistence commands

TaskCommand
Enable at bootsystemctl enable <service>
Firewall permanentfirewall-cmd --permanent --add-service=...
SELinux contextsemanage 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

PitfallWhy It HappensFix
Apache returns 403SELinux context on document rootsemanage fcontext, restorecon
Service not reachableFirewall blocks the portfirewall-cmd --permanent --add-service
Service not startingConfiguration syntax errorValidate with the service’s check command
DNS query failsZone file syntax errornamed-checkzone
DHCP client no leaseWrong subnet or rangeCheck dhcpd.conf and the interface
Proxy not workingClient not in the ACLAdd 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

ItemValue
Domain weight17%
CompetenciesHTTP, time sync, logging, DHCP, SMTP, proxy, security, centralized auth, PXE, DNS
HTTP validationapachectl configtest or nginx -t
DNS validationnamed-checkconf, named-checkzone
Mail validationpostfix check
Proxy validationsquid -k parse
Persistencesystemctl enable
Firewallfirewall-cmd --permanent
Verificationcurl, 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, and squid -k parse catch 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 enable and firewall-cmd --permanent are 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 curl with the Host header, a dig against the local resolver, a chronyc tracking query, and a nc to 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-checkconf validates the main configuration, and named-checkzone validates 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.

Was this helpful?


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!