LPIC-2 DNS, Web and Mail Services Practice Question
A web administrator has installed Apache httpd 2.4 on a Linux server. The default configuration serves files from /var/www/html. When accessing http://server/, the browser shows a directory listing of /var/www/html instead of the index.html file that exists in that directory. The administrator confirms that the user has read permissions on the file and that the file is named index.html. Which directive is most likely missing from the Apache configuration?
⚠ Common exam trap
It's easy for candidates to confuse Options +Indexes (which enables directory listings) with the DirectoryIndex directive (which specifies which file to serve instead), leading them to incorrectly choose Options -Indexes as the fix when the real issue is a missing or misconfigured DirectoryIndex.
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
✓
DirectoryIndex index.html
The DirectoryIndex directive specifies which file Apache should serve when a client requests a directory (e.g., /). Without it, or if it does not list index.html, Apache falls back to generating a directory listing (if Options +Indexes is enabled) or returns a 403 Forbidden. Since the default configuration for Apache 2.4 includes Options +Indexes and DirectoryIndex index.html, the most likely cause is that the DirectoryIndex directive was removed or overridden in a context (e.g., a <Directory> block) and no longer includes index.html, causing Apache to ignore the file and show the directory listing instead.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
IndexOptions FancyIndexing
Why it's wrong here
This controls the style of directory listing, not whether to serve a file.
- ✓
DirectoryIndex index.html
Why this is correct
Explicitly sets the file to serve when a directory is requested.
- ✗
Options -Indexes
Why it's wrong here
This disables directory listing but does not specify which file to serve.
- ✗
Require all granted
Why it's wrong here
This grants access but does not affect which file is served.
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.