I have got two 2 subdomains for the domain example.com. Which is remote.example.com and archive.example.com.
Apache is taking requests for all subdomains leading always to the same virtual host.
The Server is listening to port 8082.
This is my virtual hosts file /etc/apache2/sites-available. archive.example.com-conf:
NameVirtualHost archive.example.com:8082
<VirtualHost *:8082>
ServerAdmin webmaster@example.com
ServerName archive.example.com
DocumentRoot /var/www/archive
</VirtualHost>
When I enter remote.example.com in the browsers address line it os being routed to the same virtual host as archive.example.com.
Output of apache2ctl -S:
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/archive.example.com.conf:1
VirtualHost configuration:
*:8082 archive.example.com (/etc/apache2/sites-enabled/archive.example.com.conf:3)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33