Ubuntu, apache2 wildcard dns to subdomain
- by Mark van Velthoven
Currently I'm hosting my own (ubuntu) server with the following services: samba, ftp and a webserver. I've bought a domain and linked the DNS A-record to my ISP's IP. This is working correctly. Now I'd like to use the DNS wildcard-record to create subdomains. I want to avoid waiting 24hrs before the DNS change completes.
Thusfar I'm only able to redirect all incoming wildcards to the same directory:
test1.domain.com redirects to /var/www
test2.domain.com redirects to /var/www
Although I'd like to get:
test1.domain.com redirects to /var/www/test1
test2.domain.com redirects to /var/www/test2
My guess would be to change the file /etc/apache2/sites-available/domain.
Any help or tips would be welcome!
Thanks,
Mark