I followed these instructions to configure subdomains for apache. I can access the subdomain using http://localhost/test though I cannot access it via http://test.localhost. How can I realize the latter?
# /etc/apache2/sites-available/test.localhost
<VirtualHost *:80>
# Server name
ServerName test.localhost
# Document root
DocumentRoot /var/www/test/
# Custom log file locations
ErrorLog /var/www/test/logs/error.log
CustomLog /var/www/test/logs/access.log combined
</VirtualHost>
As Mark B already answered correctly the problem was a misconfiguration in
/etc/hosts. The correct configuration is: