Ubuntu, apache2 wildcard dns to subdomain
Posted
by
Mark van Velthoven
on Server Fault
See other posts from Server Fault
or by Mark van Velthoven
Published on 2012-08-28T09:10:14Z
Indexed on
2012/08/28
9:40 UTC
Read the original article
Hit count: 398
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
© Server Fault or respective owner