QuestionQ37

VerifiedHTTP Services

The following Apache HTTPD configuration was configured to create a virtual host available at www.example.com and www2.example.com:

Question Image

Although Apache HTTPD processed the configuration file correctly, requests to both names are not handled properly. What must be changed to ensure correct operation?

Explanation

For a name-based Apache virtual host, ServerName defines the primary hostname, while ServerAlias defines additional hostnames that should select the same virtual host. Apache matches the requested host against ServerName and ServerAlias; therefore, www.example.com should be the single ServerName and www2.example.com should be declared with ServerAlias.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!