[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 Host Name="140.229.33.200:8601" Context path="/paxAIP" docBase="/tecnet/WWW/NetScape/Alpha/paxAIP" crossContext="true" reloadable="true" trusted="false" debug="0"/ /Host 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] 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-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 In-Reply-To: B9D7EB6E06F0D1119AA800A0C9C74B4A2731C7@STR_CONNECT2 Importance: Normal X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N 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: [ANS] RE: virtual hosts on different ports
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. Connector className="org.apache.tomcat.service.PoolTcpConnector" Parameter name="handler" value="org.apache.tomcat.service.http.HttpConnectionHandler"/ Parameter name="port" value="8080"/ /Connector Connector className="org.apache.tomcat.service.PoolTcpConnector" Parameter name="handler" value="org.apache.tomcat.service.http.HttpConnectionHandler"/ Parameter name="port" value="8082"/ /Connector 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: Context path="/paxAIP" docBase="/tecnet/WWW/NetScape/Alpha/paxAIP" crossContext="true" reloadable="true" trusted="false" debug="0"/ Context path="/paxTest" docBase="/tecnet/WWW/NetScape/Alpha/paxTest" 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: Host Name="server_one" ...paxAIP context /Host Host Name="server_two" ...paxTest context /Host 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 Host Name="140.229.33.200:8601" Context path="/paxAIP" docBase="/tecnet/WWW/NetScape/Alpha/paxAIP" crossContext="true" reloadable="true" trusted="false" debug="0"/ /Host 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 HMS1GX6
[ANS] RE: virtual hosts on different ports
I tried setting up different contexts but when TOMCAT started it searched for the servlets in $TOMCAT_HOME and ignored the docBase directive. Dave From [EMAIL PROTECTED] Tue Apr 10 14:29:42 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 OAA14334 for [EMAIL PROTECTED]; Tue, 10 Apr 2001 14:29:37 -0400 (EDT) Received: by otto.nawcad.navy.mil; id OAA07525; Tue, 10 Apr 2001 14:29:37 -0400 (EDT) Received: from unknown(64.208.42.41) by otto.nawcad.navy.mil via smap (V4.2) id xma006940; Tue, 10 Apr 01 14:29:20 -0400 Received: (qmail 7703 invoked by uid 500); 10 Apr 2001 18:28:49 - 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 7694 invoked from network); 10 Apr 2001 18:28:48 - Received: from str-gw.customer.dsl.alter.net (HELO str?connect2.strllc.com) (206.114.235.241) by h31.sny.collab.net with SMTP; 10 Apr 2001 18:28:48 - Received: by STR_CONNECT2 with Internet Mail Service (5.5.2650.21) id HC3KAJXN; Tue, 10 Apr 2001 14:29:49 -0400 Message-ID: B9D7EB6E06F0D1119AA800A0C9C74B4A2731C7@STR_CONNECT2 From: Chris Andreou [EMAIL PROTECTED] To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] Subject: RE: virtual hosts on different ports Date: Tue, 10 Apr 2001 14:29:42 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N 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