LPIC-2 DNS, Web and Mail Services Practice Question
A company wants to host multiple websites on a single Apache server with different domain names. Which approach is most appropriate?
⚠ Common exam trap
Watch out — candidates often confuse name-based virtual hosting with IP-based hosting, assuming each domain needs its own IP address, or mistakenly think mod_rewrite can handle domain routing without virtual host containers.
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
✓
Name-based virtual hosting
Name-based virtual hosting allows a single Apache server to serve multiple websites using the same IP address and port by relying on the HTTP Host header sent by the client. This is the most efficient and commonly used method for hosting multiple domains on one server, as it conserves IP addresses and requires minimal configuration via the `<VirtualHost *:80>` directive.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Name-based virtual hosting
Why this is correct
Allows multiple domain names on a single IP/port using the Host header.
- ✗
IP-based virtual hosting
Why it's wrong here
Requires multiple IP addresses, which may not be available.
- ✗
Port-based virtual hosting
Why it's wrong here
Requires different ports, which is not standard for web browsing.
- ✗
Using mod_rewrite for each domain
Why it's wrong here
mod_rewrite is for URL manipulation, not for virtual hosting.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-2 question from scratch — 507 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.