Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jun 1997 11:12:19 -0500 (CDT)
From:      Alec Kloss <alec@d2si.com>
To:        webmstr@thsos.com (Paul)
Cc:        questions@FreeBSD.ORG
Subject:   Re: DNS or Apache?
Message-ID:  <199706231612.LAA06140@d2si.com>
In-Reply-To: <2.2.32.19970623013412.006a56d4@mail.thsos.com> from Paul at "Jun 22, 97 08:34:12 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Paul is responsible for:
> Hi,
> 
> I tried to set up a virtual server using the
> name retail.foo.com. I already have a working
> server on www.foo.com. The retail version points
> to a different directory. 
> My domain.db looks like this.....
> 
> localhost  IN      A               127.0.0.1
> ;
> ;
> mymachine  IN      A               200.100.100.1
> ;
> router     IN      A               200.100.100.2
>            IN      MX              10 mail.mydomain.com.
> ;
> ftp        IN      CNAME           mymachine.mydomain.com.
> mail       IN      CNAME           mymachine.mydomain.com.
> news       IN      CNAME           mymachine.mydomain.com.
> ns         IN      CNAME           mymachine.mydomain.com.
> www        IN      CNAME           mymachine.mydomain.com.
> retail     IN      CNAME           mymachine.mydomain.com.
> 
> retail.mydomain.com resolves to my web server...
> my foo.com record looks like this........
> 
> @    IN    SOA     foo.com.      hostmaster.foo.com. (
>                                         15      ;Serial number
>                                         172800  ;Refresh every 2 days
>                                         3600    ;Retry every 2 day
>                                         1728000 ;Expire every 20 days
>                                         172800 )   ;Minimum 2 days
> ;
>            IN      NS              ns.mydomain.com.
>            IN      NS              ns2.backup.net.
>            IN      MX              5 mail.foo.com.
> ;
> localhost  IN      A               127.0.0.1
> www        IN      A               200.100.100.5
> retail     IN      A               200.100.100.5
>            IN      MX              10 mail.foo.com.
> mail       IN      CNAME           mail.mydomain.com.
> 
> the virtual hosts in the web server httpd.conf are set up as
> one is www.foo.com 
> the other retail.foo.com
> with two different directories specified
> 
> I tried using the same Internet address then tried setting up 
> a different ethernet address in the netstart...
> neither way works to resolve to the virtual web server the error
> is retail.foo.com  DNS entry not found
> I did also include the retail.foo.com in the reverse.db
> 
> Can someone let me know what I am doing wrong? Or suggest a better
> way for doing... like one that works?
> 
> Thanks,
> 
> Paul Webmaster@thsos.com
> 

As I understand it, you must create multiple IP addresses for the web
server.  What happens is, first the host name is resolved into a IP
address by the client, and then the client connects to the address.
There is no way for the server to figure out what DNS name was used to
connect, just the address.  You'll have to use the alias option of
ifconfig to assign a network card several IP addresses, and then bind
each address to a specific hostname, and then set up Apache with
Virtual Host directives for each address.  

The ifconfig command to add an alias is
        ifconfig ed? inet 200.100.100.5 netmask 0xffffffff alias

I hope this helps a bit.  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706231612.LAA06140>