I'm just wondering how to set a default website in the Apache config file. I've set up the server configuration and thought that would have been the default website as below.
ServerAdmin <contact email>
ServerName <server domain>:80
However, it appears that it's not the default website when entering the IP or a domain that hasn't been entered as a virtual-host entry. From trying a few different entries in the httpd.conf, it appears which ever virtual-host entry comes first becomes the default website. I've worked around this problem is by doing the following creating the entry as below.
So if I enter the server IP, mail.example.com, ftp.example.com, mail.second-example.com, etc, it'll retrieve the website from "/var/www/html" (ie the first virtual-host entry). If I entered the URL for all the website, it'll retrieve whatever documents it's meant retrieve. However, I find this somewhat not very elegant and just wondering if there's a better approach to do this.
### Section 3: Virtual Hosts
ServerName <the server ip>