I have set up LAMP stacks on both Ubuntu 20.04 and Debian 10 running Apache 2.4.
The VirtualHost Files are identical as follows :
<VirtualHost localhost:80>
ServerAdmin webmaster@localhost
ServerName subdomain.localhost
ServerAlias www.subdomain.localhost
DocumentRoot /var/www/localhost/subdomain
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I have dissabled the default site and enabled the localhost site on both machines.
On Ubuntu i can just visit subdomain.localhost (and www.subdomain.locahost) via my browser. On Debian, however, I have to add an entry to the /etc/hosts file for every subdomain I'd like to create/use.
Why is that? Whats the difference between Debain and Ubuntu that causes that?
Am I able to configure Debian in a way so that I do not need to add an entry for every subdomain for localhost?