Exam 202-450 All QuestionsBrowse all questions from this exam
Question 70

The following Apache HTTPD configuration has been set up to create a virtual host available at www.example.com and www2.example.com:

Even though Apache HTTPD correctly processed the configuration file, requests to both names are not handled correctly. What should be changed in order to ensure correct operations?

    Correct Answer: E

    To ensure correct operations, only one ServerName directive can be used, specifying the primary domain name (e.g., www.example.com). Additional names should be declared using the ServerAlias directive. This is because ServerName can only specify one name, and using ServerAlias allows you to define additional virtual host names as aliases for the primary name.

Discussion
carlkktwOption: E

The answer should be 'E'.

frantic25Option: E

According to apache doc, ServerName can specify just one name. ServerAlias can specify more aliases. http://httpd.apache.org/docs/2.2/mod/core.html#servername

excoOption: E

Despite the fact that it is possible to use comma in ServerName dierective, that is not the correct anwer. I just passed today the exam with 800 points and have chosen the E as the answer.

mira_Option: E

ServerName can specify just one name. ServerAlias can specify more aliases.

ArminaOption: E

E is correct!

blahaltOption: E

ONLY E is correct !

jchavarria12Option: E

the right one is E

LantosOption: E

The apache 2.4 doc says that "The ServerName directive may appear anywhere within the definition of a server. However, each appearance overrides the previous appearance (within that server)". This tells me that ServerName cannot be used to define alias addresses.

MBisonOption: E

Also the documentation of Apache 2.4 specifies only one ServerName: https://httpd.apache.org/docs/2.4/en/mod/core.html#servername I think too, the correct answer should be 'E'. You can also split the configuration in 2 Virtual Hosts. But the answer is not correct, because the write "you have to".

tcaseitOption: C

Just tested and C definitely works on Apache 2.4.41 on Ubuntu Server 20.04. Not sure if it is supposed to but it does. Also tried with a single ServerName and a ServerAlias it exhibited the same results though.