CompTIA Server+ (SK0-005)Server AdministrationEasy
A server administrator is configuring a new web server running Apache that needs to host multiple domains (e.g., example.com, example.org) on the same IP address and port. Each domain must serve content from a different directory. Which Apache feature should the administrator use to achieve this?
- AProxyPass directives
- BAlias directives
- CRewriteEngine rules
- DVirtual Hosts
Show answer & explanationAnswer & explanation
Correct answer: D. Virtual Hosts
Apache Virtual Hosts allow a single Apache web server to host multiple websites or domains, each with its own configuration, directory, and other settings, all while sharing the same IP address and port.
Why the other options are wrong
- A. ProxyPass is used for reverse proxying requests to different backend servers, not for hosting multiple domains on the same server.
- B. Alias directives map a URL path to a specific directory within a single website's configuration, not for defining separate domains.
- C. RewriteEngine is used for URL manipulation and redirection, not for defining separate websites on the same server.
Apache Virtual Hosts
A configuration feature in Apache HTTP Server that allows a single server to host multiple websites/domains.
- Can be IP-based or name-based.
- Each virtual host can have its own document root, logs, and configuration.
- Commonly used for shared hosting environments.
Memory trick: One server, many virtual homes.