0

EVERYTHING HAS BEEN SOLVED - no need to answer :)

I'm setting a local webserver to do a lot of web development work from now on. I'm not really knowledgeable in hosting configuration.

Thing is I just added mydomain.com in /etc/hosts that's fine but what's the next step?

TI need to use the wildcard on *.mydomain.com, so I'm figuring I need to add my zone in bind, is this correct? so I can make use of virtual hosts in apache and in play-framework

Everything will be local, but once in a while I want to make public of my webserver to certain people using the no-ip service, in windows I've done it, in linux I don't know if it's any difference.

The question is pretty much if I'm configuring it right or not? If this sounds confusing let me know, I'll try to detail it more

2
  • 2
    Please post your solution and accept your answer, in order to close this question correctly.
    – user3914
    Dec 31, 2010 at 2:56
  • 1
    My answer added, but I cannot choose it within two days... (says the system)
    – allenskd
    Dec 31, 2010 at 4:46

1 Answer 1

1

To set up your own "local domain" you need to edit your /etc/hosts first, add your domain e.g 127.0.0.1 mydomain.com mydomain_alias save your /etc/hosts.

After that you need to install bind and edit your named.conf, in this step I used webmin because it's so much easier than going through terminal. I added my master zone called mydomain.com and added the following addresses:

  • www.mydomain.com
  • *.mydomain.com
  • test.mydomain.com

Next, we edit /etc/default/bind9, be sure RESOLVCONF=yes is there, else add it. To disable ipv6 believe me you might want to because in your system logs it starts trying to figure out ipv6 of requests. So make it IpV4 only,

End result might look like this, whereas -4 refers to the internet protocol version

OPTIONS="-4 -u bind"

Once you configure bind properly you are almost ready to go.

Next step, edit your /etc/resolv.conf

Put nameserver 127.0.0.1 as the very first of your nameservers. Now to test your wildcard, set up apache, set virtual hosts google for more reference

Simple example:

<VirtualHost *>

   ServerName www.mydomain.com
   ServerAlias *.mydomain.com
   DocumentRoot /path/to/documentroot
</VirtualHost>

Enjoy, any doubts just comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .