CompTIA Server+ (SK0-005)Server AdministrationEasy
A server administrator is configuring a new web server that needs to serve multiple distinct websites, each with its own domain name (e.g., www.example.com, www.anothersite.org) and content, from a single IP address. Which web server feature enables this functionality?
- AContent Delivery Network (CDN)
- BVirtual hosts
- CReverse proxy
- DLoad balancing
Show answer & explanationAnswer & explanation
Correct answer: B. Virtual hosts
Virtual hosts (or server blocks in Nginx) allow a single web server to host multiple domain names on the same IP address, directing requests to the appropriate content based on the incoming domain name in the HTTP request header.
Why the other options are wrong
- A. A CDN caches content geographically to improve delivery speed, unrelated to hosting multiple domains on one server.
- C. A reverse proxy sits in front of web servers to forward client requests, but doesn't inherently host multiple sites itself.
- D. Load balancing distributes traffic across multiple servers, not for hosting multiple sites on one server.
Virtual Hosts
A web server configuration that allows a single server to host multiple domain names, each with its own content and settings.
- Uses the 'Host' header in HTTP requests to differentiate sites.
- Can be IP-based or name-based.
- Commonly used in Apache and Nginx.
Memory trick: Virtual hosts are like apartments in one building, each with its own address.