LPIC-2 System Security Practice Question
An administrator wants to enhance the security of a web server running Apache. Which TWO of the following actions are recommended best practices?
⚠ Common exam trap
Many candidates confuse enabling `.htaccess` files (Option C) with a security best practice, when in fact it is a security anti-pattern that reduces performance and control, while the correct hardening step is to disable them and centralize configuration.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Disable directory listing in the Apache configuration using Options -Indexes.
Disabling directory listing with `Options -Indexes` prevents Apache from generating a list of files in directories that lack an index file (e.g., index.html). This is a fundamental security hardening step that reduces information disclosure about the web server's file structure, which could be leveraged by an attacker to find sensitive files or configuration details. Option D is correct because running Apache worker processes as a non-root user (e.g., www-data) minimizes the impact of a potential security breach. If an attacker compromises a worker process, they will not have root privileges, limiting the damage. This is a principle of least privilege and a standard security best practice.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable the mod_info module to monitor server configuration.
Why it's wrong here
mod_info exposes sensitive server information and should be disabled in production.
- ✓
Disable directory listing in the Apache configuration using Options -Indexes.
Why this is correct
Disabling directory listing prevents attackers from browsing directory contents.
- ✗
Enable .htaccess files to allow per-directory configuration changes.
Why it's wrong here
.htaccess files can introduce performance overhead and security risks; it's better to place configuration in the main server config.
- ✓
Run the Apache worker processes as a non-root user such as www-data.
Why this is correct
Running as a non-privileged user limits the impact of a security breach.
- ✗
Enable the HTTP TRACE method for debugging purposes.
Why it's wrong here
The TRACE method can be exploited for Cross-Site Tracing attacks and should be disabled.
Go deeper
Related to this question
About these practice questions
This LPIC-2 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.