RE: [ANS] RE: virtual hosts on different ports

2001-04-11 Thread William Wishon

If you reread my first response I say that it isn't possible to restrict one
context to one port and another context to another.  Having said that if you
are ok with both of your contexts being accessible on both ports all you
need to do is declare two Connectors.













Having done this in your server.xml you will now be able to access tomcat on
both ports 8080 and 8082.  Adding some contexts now:

>   docBase="/tecnet/WWW/NetScape/Alpha/paxAIP"
>  crossContext="true"
>  reloadable="true"
>  trusted="false"
>  debug="0"/>

 

After this you should have access to http://server:8080/paxAIP
http://server:8080/paxTest http://server:8082/paxAIP
http://server:8082/paxTest.

There are no Host directives necessary.  But if you did want to first wrap
the contexts in Host directives you could do:


...paxAIP context



...paxTest context


Now you can access http://server_one:8080/paxAIP
http://server_one:8082/paxAIP http://server_two:8080/paxTest
http://server_two:8082/paxTest but you will not have access to
http://server_one:8080/paxTest http://server_one:8082/paxTest
http://server_two:8080/paxAIP http://server_two:8082/paxTest.


Hope that helps.

-Bill

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 11, 2001 7:00 AM
> To: [EMAIL PROTECTED]
> Subject: [ANS] RE: virtual hosts on different ports
>
>
> Bill,
>
>   What you stated is what I'm trying to do. I have a single
> server, in which I need to utiltize ports 8601 and 443.  But, I
> want each port to examine a certain 'context'.  Right now I'm
> manily concerned about 8601 for our developemt team.
> Here is my entry from the server.xml and httpsd.conf file.  But,
> when I try to connect to the pages I receive a 404 error and in
> the jasper log file I notice TOMCAT is trying to excute the code
> from $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes directory.  Can
> you give me a clue on what I'm doing wrong.
>
>  Thanks a bunch.
>
> server.xml
>
> 
>   docBase="/tecnet/WWW/NetScape/Alpha/paxAIP"
>  crossContext="true"
>  reloadable="true"
>  trusted="false"
>  debug="0"/>
> 
>
> httpsd
>
> #  General setup for the virtual host
> DocumentRoot "/tecnet/WWW/NetScape/Alpha"
> ServerName tecnet1.jcte.jcs.mil
> ServerAdmin [EMAIL PROTECTED]
> ErrorLog logs/tecnet8601_error_log
> TransferLog logs/tecnet8601_access_log
> SetEnvIf Request_URI wwwAuthenticatedEntrance.cgi$ login
> CustomLog logs/agent_log loginagent env=login
> JkMount /*.jsp ajp13
> JkMount /servlet/* ajp13
>
> Dave
>
>
> > From
> [EMAIL PROTECTED]
> .org  Tue Apr 10 14:50:35 2001
> > Received: from otto.nawcad.navy.mil
> (otto-internal.nawcad.navy.mil [192.58.199.212])
> > by tecnet1.jcte.jcs.mil (8.9.3/8.9.3) with ESMTP id OAA19625
> > for <[EMAIL PROTECTED]>; Tue, 10 Apr 2001 14:50:34
> -0400 (EDT)
> > Received: by otto.nawcad.navy.mil; id OAA20256; Tue, 10 Apr
> 2001 14:50:34 -0400 (EDT)
> > Received: from unknown(64.208.42.41) by otto.nawcad.navy.mil
> via smap (V4.2)
> > id xma019868; Tue, 10 Apr 01 14:50:27 -0400
> > Received: (qmail 45293 invoked by uid 500); 10 Apr 2001 18:49:36 -
> > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> > Precedence: bulk
> > Reply-To: [EMAIL PROTECTED]
> > list-help: <mailto:[EMAIL PROTECTED]>
> > list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> > list-post: <mailto:[EMAIL PROTECTED]>
> > Delivered-To: mailing list [EMAIL PROTECTED]
> > Received: (qmail 45276 invoked from network); 10 Apr 2001 18:49:36 -
> > Received: from unknown (HELO jnm-main.pictureiq.com) (63.127.69.253)
> >   by h31.sny.collab.net with SMTP; 10 Apr 2001 18:49:36 -
> > Received: from ecto1 (jnm0-215 [192.168.0.215]) by
> jnm-main.pictureiq.com with SMTP (Microsoft Exchange Internet
> Mail Service Version 5.5.2653.13)
> > id HMS1GX6X; Tue, 10 Apr 2001 11:54:00 -0700
> > From: "William Wishon" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Subject: RE: virtual hosts on different ports
> > Date: Tue, 10 Apr 2001 11:48:33 -0700
> > Keywords: MailingLists
> > Message-ID: <[EMAIL PROTECTED]>
> > MIME-Version: 1.0
> > Content-Type: text/plain;
> > charset="iso-8859-1"
> > Content-Transfer-

RE: virtual hosts on different ports

2001-04-10 Thread William Wishon

You can configure tomcat to listen on multiple ports, but you cannot
restrict particular contexts to particular ports.  If you setup tomcat to
listen on ports 8080 and 8082 then all of your contexts become available on
both ports.  Using virtual hosts you can restrict particular contexts to
particular virtual hosts, but all virtual hosts are available on all ports.

That's what I found when I did some research and code archeology a little
while ago. I wanted to separate two contexts by restricting the first
context to the first port, and assigning the second context to the second
port.

-Bill

> -Original Message-
> From: Chris Andreou [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 10, 2001 11:30 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: virtual hosts on different ports
>
>
> you can create different contexts that listen on different ports
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 10, 2001 1:22 PM
> To: [EMAIL PROTECTED]
> Subject: virtual hosts on different ports
>
>
> Hi,
>
>  Can I configure TOMCAT virutal hosts on different ports, not ip
> addresses?
> I seen this question asked in the archives but there was no responses.
>
> Dave




RE: Different hosts with different ports

2001-03-05 Thread William Wishon

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:[EMAIL PROTECTED]]
> 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:
>   
>   
>
>   
>   
>
> 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.
> [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Assigning Servlets to different ports.

2001-03-05 Thread William Wishon

> In Tomcat 3.3, you can setup two different ContextManager's, so
> each will listen to a
> different port. I believe it should be the same in 3.2.1?

In the configuration I am looking at (for Tomcat 3.2.1) it looks like the
connectors are where the port numbers get assigned.  Is there a port
property that can be set on the ContextManager?  If so do you know how it
interacts with the port settings on the Connectors?  I have been playing
around with multiple ContextManagers each with a TcpPoolConnector with
different port settings and different Hosts with Contexts mapping different
servlets to "/", but I haven't yet found a combination that works for me.
I've even tried giving each ContextManager its own home directory, work dir,
webapps dir, etc.

I'm going to keep fiddling around and looking through the code to see what I
can find, but it you have any more suggestions please post them.

The thing I am looking into now are a few properties of the TcpPoolConnector
that look promising, they are 'vhost_port', 'vhost_name', and
'vhost_address'.  I tried what seemed obvious to me, with no luck.  I have
yet to discover how these settings on the Connector interact with the
Contexts that are part of the Hosts.  In my grep'ing through the source the
only place I've found that looks at these values is
org/apache/tomcat/startup/EmbededTomcat.java, which didn't look promising,
so maybe they are for a feature not yet implemented.

> > I also want the default servlet mappings turned off so
> that I am no longer
> > able to access the servlets as "/webapp_name/" when tomcat
> starts and finds
> > a war file named "webapp_name".  I only want Tomcat to serve
> the servlets
> > that I setup explicitly in server.xml.
>
> I'm at a loss here. Isn't web.xml the file that sets servlets up?

I figured out how to do that, by removing the AutoSetup ContextInterceptor I
was able to get stop tomcat from installing the webapps it finds
webapps/foo.war into http://host/foo/
This has the other side effect of not automatically exploding war files that
it finds in the webapps directory, but that's fine by me.

> > That gives me a different document root for each port.  What I want from
> > Tomcat is a different servlet to handle requests on each port.
>
> With two ContextManager's you should be able to do what you want;
> I haven't tried it,
> though.

One kind message I get when using two ContextManagers are messages about the
removing of duplicate servlets.  Now I have all sorts of debug flags turned
on so they might be harmless, but I don't get the messages with only one
ContextManager.

Thanks,
Bill


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Server.xml DTD?

2001-03-02 Thread William Wishon

Is there a DTD for server.xml?  If so could somebody point me at it.

Thanks,
Bill

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Assigning Servlets to different ports.

2001-03-02 Thread William Wishon

Here's the problem I keep running up against.

The top level XML element is a Server, it contains a ContextManager.The
ContextManager contains both the Connector, which defines the port to listen
on, and the Context entries at the same level.  How do I associate
particular contexts with particular Connectors?  Right now I seem only able
to have one servlet context that maps to "/".  I really should be able to
have two servlets that map to "/", one "/" for port 8080 and one "/" for
port 8081.

I also want the default servlet mappings turned off so that I am no longer
able to access the servlets as "/webapp_name/" when tomcat starts and finds
a war file named "webapp_name".  I only want Tomcat to serve the servlets
that I setup explicitly in server.xml.

One way of achieving this in an apache world would be:

NameVirtualHost 10.0.0.1:8080
NameVirtualHost 10.0.0.1:8081


ServerName port8080.domain.com
DocumentRoot /home/httpd/port8080




ServerName port8081.domain.com
DocumentRoot /home/httpd/port8081




That gives me a different document root for each port.  What I want from
Tomcat is a different servlet to handle requests on each port.

-Bill

> -Original Message-
> From: Alex Fernández [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 02, 2001 4:07 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Assigning Servlets to different ports.
>
>
> Hi William!
>
> Configure two contexts, and load each servlet in one context.
>
> Un saludo,
>
> Alex.
>
> William Wishon wrote:
>
> > Hi,
> >
> > I am trying to assign one of my servlets (say servlet1)
> to port 8080 and
> > another one (say servlet2) to port 8081.  I want them totally
> separate so
> > that I can't access servlet2 on port 8080 nor servlet1 on 8081.
>  Can anyone
> > help me figure out how to do this?
> >
> > -Bill
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Assigning Servlets to different ports.

2001-03-01 Thread William Wishon

Hi,

I am trying to assign one of my servlets (say servlet1) to port 8080 and
another one (say servlet2) to port 8081.  I want them totally separate so
that I can't access servlet2 on port 8080 nor servlet1 on 8081.  Can anyone
help me figure out how to do this?

-Bill


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]