DNS / Webserver in a project environment

Preston Hagar prestonh at gmail.com
Tue Feb 23 16:54:30 UTC 2010

On Tue, Feb 23, 2010 at 8:36 AM, Reineke Fuchs <malepatus at googlemail.com> wrote:
> Hello Ubuntuusers,
> I'd like to set up a Webserver (Apache) within a DNS-Server.
> I'd like to create my own namespace (just for this small subnet) and give
> around 10 people webspace.
> It's possible, that I haven't understood DNS, but how can send a DNS-Query
> into a sub-directory?
> Example:
> user1.test.com  ==> /var/www/user1/index.html
> user2.test.com  ==> /var/www/user2/index.html
> ...
> user10.test.com  ==> /var/www/user10/index.html
> My status now:
> test.com ==> ==> /var/www/index.html ==> It works.
> How do I link DNS to a directory and not to an IP?
> Best greetings
> jaik
> --

Virtual Hosts:


As a basic example in your apache config could put something like this:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName user1.test.com
DocumentRoot /var/www/user1

That page should give you the info you need.  As for DNS, that is a
completely seperate issue.  If it truly is just ten users and you
aren't going to change things, you could take a super easy route and
just add the enteries to the users hosts file.  Of course, if anything
ever changes, you would have to go around and update everyone's
machine again.  The other option would be to setup either djbdns,
PowerDNS, Bind, or another internal DNS server and create your entries
in it.  If you are comfortable setting up a Postgresql database, I
would recommend PowerDNS, otherwise I would recommend djbdns.  Just
google the names and you should be able to find some setup guides
pretty easily.


More information about the ubuntu-users mailing list