You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christian Parpart <cp...@t-online.de> on 2001/03/05 22:42:05 UTC

Different hosts with different ports

Hi *

how can I declare multiple hosts
listening on different ports?

example:
  <Host name="www.a.com" port="80">
  </Host>                ^^^^

  <Host name="www.b.com" port="8080">
  </Host>                ^^^^

This is possible with IIS. 
But the port attribute has to appear 
anywhere else (Engine/Connector/@port).

Is there any way to do this anyway?

Thanks in advance,
Christian Parpart.
cparpart@surakware.com


RE: Different hosts with different ports

Posted by William Wishon <bi...@pictureiq.com>.
I'm trying to do a very similar (if not the same) thing.  You might want to
check out the thread "Assigning Servlets to different ports.".

If you are OK with having every servlet available on all virtual hosts then
you just need to add another Connector and change the port property.  That
will let Tomcat listen and respond on both ports for both virtual hosts.
This allows for www.a.com and www.b.com to have different root pages.
Referring to your example, what it does not do is prevent you from getting
www.a.com's homepage by using http://www.a.com:8080/  which is what I want
to prevent.  I want to have none of www.a.com's content available on port
8080 and none of www.b.com's content available on port 80.

I'm fiddling around with server.xml while looking through the code and am
beginning to think that it is going to require some code changes.

-Bill

> -----Original Message-----
> From: Christian Parpart [mailto:cparpart@t-online.de]
> Sent: Monday, March 05, 2001 1:42 PM
> To: Apache Tomcat User MailingList
> Subject: Different hosts with different ports
>
>
> Hi *
>
> how can I declare multiple hosts
> listening on different ports?
>
> example:
>   <Host name="www.a.com" port="80">
>   </Host>                ^^^^
>
>   <Host name="www.b.com" port="8080">
>   </Host>                ^^^^
>
> This is possible with IIS.
> But the port attribute has to appear
> anywhere else (Engine/Connector/@port).
>
> Is there any way to do this anyway?
>
> Thanks in advance,
> Christian Parpart.
> cparpart@surakware.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org