I'm using ubuntu 8.04 and apache2, for my development I need a wildcard sub domains.
for example If I go to abc.localhost/ it should redirect to localhost/
Can you guys help me out how I can achieve this in ubuntu 8.04.
Well I Configured it after so much RnD I was not able to use /etc/hosts file because I wanted a wildcard subdomain.
here 192.168.0.2 is my machine and 192.168.0.1 is dns server
It's perfectly doable, however you need at least one of the following:
If it isn't possible to add a record to your existing DNS server, but you have root on your system, then you should:
Configure Apache to use a default virtual host.
This link should help.
While you can not do wildcards this way, you might fins simply adding entries to
For example you could add the following lines:
The OS (and therefore most applications, those that don't try be clever and do their own DNS lookups) will be default use values from
Apache configuration would be the same, wether you sort the name->address mapping via DNS or via hosts file. Also, with either technique you may need to restart client applications (or force a full refresh in web browsers with Ctrl+F5) after making changes as they may cache hostname->address lookup results for a while.