Welcome to the new Linux Foundation Forum!

Solution 7.3 question

fliker09fliker09 Posts: 39
edited October 2017 in LFS211 Class Forum

Is

<VirtualHost *:80>


DocumentRoot $DOCUMENTROOT


ServerName _default_


</VirtualHost>

required on Ubuntu considering the fact that there is /etc/apache2/sites-enabled/000-default.conf ?

Comments

  • lee42xlee42x Posts: 116
    edited September 2017

    The server name _default_ is a special name and should be included, You may add it to the bottom of 000-default.conf if you wish.  

    The importance of _default_ server name is any http connection that is not specifically identified in "ServerName" entry of a ".conf" file will use the "first valid" virtual host configuration information. To control which virtual host entry is used as "first" with the _default_  server name. You can see this effect if you connect via the ip address rather than the dns name, assuming the ipaddress are not specified  in the the "ServerName" field of the ".conf" file(s). 

  • fliker09fliker09 Posts: 39
    edited September 2017

    Ok, may be I should describe my situation. I made a typo in namevhost.conf file (namevhost.examle.com instead of namevhost.example.com). So, when I tried to access namevhost.example.com (it was included in /etc/hosts as described in solution), I got the page from localhost, which is the default one, thanks to the 000-default.conf file (as I can understand 000 was specifically for that purpose put at the begginning of the filename).

Sign In or Register to comment.