Implementing the virtual port based Host

Barry Margolin barmar at bbnplanet.com
Fri Jun 18 18:45:39 UTC 1999


In article <376A19B1.18680ADA at nortelnetworks.com>,
Basil Paalarjee <basil at nortelnetworks.com> wrote:
>Does anyone know how the port based virtual host works? Or how to a web
>server can be made have port based virtual hosts?
>
>Eg. port 8080: www.Iassignthis.com
>    port :8888:www.anothername.com
>
>How to implement this is C for a web server ?

Do you mean that if someone says http://www.iassignthis.com it should act
as if they said http://www.iassignthis.com:8080, and if they say
http://www.anothername.com it should act like
http://www.anothername.com:8888?  There's no way to make that happen.  DNS
doesn't currently provide a way to specify port numbers (the new SRV
records could conceivably do this, but no browsers make use of it for this
purpose).  The default port is derived from the URL's scheme: http = 80,
https = 443.

If you're willing to require the user to specify the port# explicitly in
the URL, and just need to know how to connect different ports to different
virtual hosts, check the documentation of your web server software.  I
think this is typically done by running multiple daemons, specifying a
different DocumentRoot and Port in each one's configuration file.

-- 
Barry Margolin, barmar at bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.



More information about the bind-users mailing list