RE: Tomcat 4.1.12 taking IPs or Ports not assigned to it?

2002-10-27 Thread Nathan Phelps
 It's by design.

Tomcat design or JVM design?  After doing more research I have determined
that this effects all use of ServerSocket in Java.  So are we saying this is
not a bug?  This is the way Sun designed it to work?  Why?

Here is a test app I used to conclude that it effects all instances of
ServerSocket.

public static void main(String[] args) {
try {
java.net.ServerSocket serverSocketOne = new java.net.ServerSocket();
java.net.ServerSocket serverSocketTwo = new java.net.ServerSocket();

java.net.InetAddress bindAddressOne = 
java.net.InetAddress.getByName(args[0]);

java.net.InetAddress bindAddressTwo =
java.net.InetAddress.getByName(args[0]);

java.net.InetSocketAddress socketAddressOne = 
new java.net.InetSocketAddress(
bindAddressOne, Integer.valueOf(
args[2]).intValue());

java.net.InetSocketAddress socketAddressTwo = 
new java.net.InetSocketAddress(
bindAddressTwo, Integer.valueOf(
args[2]).intValue());

System.out.println(About to bind to  + 
   bindAddressOne.getHostAddress() + : + args[2]);

serverSocketOne.bind(socketAddressOne);
if (!serverSocketOne.isBound()) {
System.out.println(Couldn't bind to  + 
   bindAddressOne.getHostAddress());
return;
}
System.out.println(Bound to  + bindAddressOne.getHostAddress());

System.out.println(About to bind to  + 
   bindAddressTwo.getHostAddress() + : + args[2]);

serverSocketTwo.bind(socketAddressTwo);
if (!serverSocketTwo.isBound()) {
System.out.println(Couldn't bind to  + 
   bindAddressTwo.getHostAddress());
return;
}
System.out.println(Bound to  + bindAddressTwo.getHostAddress());

serverSocketOne.close();
serverSocketTwo.close();
}
catch (ArrayIndexOutOfBoundsException exception) {
System.out.println(
  IpBind ip address one ip address two  +
  port number);
}
catch (java.io.IOException ioException) {
System.out.println(Error:  + ioException.getMessage());
}
}

-Original Message-
From: Robert L Sowders [mailto:rsowders;usgs.gov]
Sent: Saturday, October 26, 2002 5:25 AM
To: Tomcat Users List
Subject: Re: Tomcat 4.1.12 taking IPs or Ports not assigned to it?


It's by design. 

Try using two nic's on different subnets.  Say 1.2.3.4 and 1.2.4.4.

rls

--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Tomcat 4.1.12 taking IPs or Ports not assigned to it?

2002-10-27 Thread W. Egan
Its a Microsoft design problem.  I guess.  If IIS listens on port 80 on ANY
address on a given machine, it binds 0.0.0.0:80.  It's called socket
pooling.  Nothing else will be able to bind 80 once IIS is started.  And if
something else starts first and binds 80, IIS wont be able to.  I ran into
the same problem.  See this remedy:

Socket Pooling (Binding IIS to 0.0.0.0:80)
Socket pooling causes Internet Information Services (IIS) 5.0 to listen to
all IP addresses, which can present a possible security risk for secure
domains with multiple networks. Also, bandwidth throttling and performance
adjustments will apply to all Web sites configured for the same port (for
example port 80). If bandwidth throttling or performance tuning is being
done on a per-site basis, socket pooling will need to be disabled.
To disable socket pooling, perform the following steps:
cscript adsutil.vbs set w3svc/disablesocketpooling true
The command replies as follows:
disablesocketpooling : (BOOLEAN) True
Stop and start the IISAdmin service.
Restart the WWW service.

Once you do this, you can have both IIS and Apache/Tomcat listening on port
80 on different IPs on the same machine.  No need for multiple nic's and
multiple network segments either.

hope this helps,
began

- Original Message -
From: Robert L Sowders [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, October 26, 2002 5:24 AM
Subject: Re: Tomcat 4.1.12 taking IPs or Ports not assigned to it?


 It's by design.

 Try using two nic's on different subnets.  Say 1.2.3.4 and 1.2.4.4.

 rls





 Nathan Phelps [EMAIL PROTECTED]
 10/25/2002 12:20 PM
 Please respond to Tomcat Users List


 To: '[EMAIL PROTECTED]'
[EMAIL PROTECTED]
 cc:
 Subject:Tomcat 4.1.12 taking IPs or Ports not assigned to
it?


 EXECUTIVE SUMMARY:
   - Single Windows 2000 (SP3) Server with JDK 1.4.1_01
   - Running IIS 5.0 and Tomcat 4.1.12
   - Two IP addresses assigned to a single NIC (1.2.3.4, and 1.2.3.5 for
 example)
   - IIS has one website (all other websites have been stopped) assigned to
 1.2.3.4:80
   - Tomcat has one website assigned to 1.2.3.5:80
   - If Tomcat is started after IIS, Tomcat reports
 java.net.BindException:
 Address already in use: JVM_Bind:80
   - If Tomcat is started before IIS, IIS reports Address already in use
   - Tomcat server.xml file is included at bottom.

 MORE DETAILS:
 I have a Windows 2000 Server (SP3) with IIS 5.0 and Tomcat 4.1.12
 installed
 using JDK 1.4.1_01.  The machine has two static IPs assigned to it (I'll
 use
 1.2.3.4, and 1.2.3.5 for examples) and the IIS website is configured to
 use
 one of these address at port 80 (1.2.3.4).  The default Tomcat HTTP1.1
 connector has been updated and the configuration file has been modified by
 adding the address attribute and assigning the other IP (1.2.3.5) to it.
 The port attribute has been modified to port 80.

 When I try and start Tomcat, it reports that the address is already in
 use.
 However, I have verified that it is indeed NOT in use.  I have verified
 this
 assumption by creating an additional IIS website and assigning it to the
 IP
 I had assigned to the Tomcat connector (1.2.3.5) as well as to port 80.  I
 can start both IIS websites (1.2.3.4:80 and 1.2.3.5:80) and access them
 both
 with the correct IPs.

 An additional test I conducted was to stop all IIS websites, and then
 start
 Tomcat on its previously assigned IP (1.2.3.5) on port 80.  It started
 successfully and could be accessed.  Then, however, I tried to start the
 original IIS website (on 1.2.3.4), and it failed to start reporting the
 address was in use.  The ONLY way I could get them both running was to
 assign them different port numbers (which sort of eliminates the whole
 purpose of having two different IPs in the first place).  How can I fix
 this
 issue?

 TOMCAT CONFIGURATION FILE:
 My configuration file (with the sample IP and comments removed) looks like
 this:

 Server port=8005 shutdown=SHUTDOWN debug=0
   Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
 debug=0 port=-1 login=admin password=admin/

   Service name=Tomcat-Standalone

 Connector className=org.apache.coyote.tomcat4.CoyoteConnector
port=80 minProcessors=5 maxProcessors=75
enableLookups=true redirectPort=8443
acceptCount=10 debug=0 connectionTimeout=6
 address=1.2.3.5/

 Engine name=Standalone defaultHost=localhost debug=0

   Logger className=org.apache.catalina.logger.FileLogger
   prefix=catalina_log. suffix=.txt
   timestamp=true/

   Realm className=org.apache.catalina.realm.MemoryRealm /

   Host name=localhost debug=0 appBase=webapps
unpackWARs=true autoDeploy=true

 Valve className=org.apache.catalina.valves.AccessLogValve
  directory=logs  prefix=localhost_access_log.
 suffix=.txt
  pattern=common

RE: Tomcat 4.1.12 taking IPs or Ports not assigned to it?

2002-10-27 Thread Nathan Phelps
That is it!  I ran the script as described and it works!  Thank you so much.
This was a big help.

-Original Message-
From: W. Egan [mailto:khayman1122;hotmail.com]
Sent: Sunday, October 27, 2002 11:14 AM
To: Tomcat Users List; Nathan Phelps
Subject: Re: Tomcat 4.1.12 taking IPs or Ports not assigned to it?


Its a Microsoft design problem.  I guess.  If IIS listens on port 80 on ANY
address on a given machine, it binds 0.0.0.0:80.  It's called socket
pooling.  Nothing else will be able to bind 80 once IIS is started.  And if
something else starts first and binds 80, IIS wont be able to.  I ran into
the same problem.  See this remedy:

Socket Pooling (Binding IIS to 0.0.0.0:80)
Socket pooling causes Internet Information Services (IIS) 5.0 to listen to
all IP addresses, which can present a possible security risk for secure
domains with multiple networks. Also, bandwidth throttling and performance
adjustments will apply to all Web sites configured for the same port (for
example port 80). If bandwidth throttling or performance tuning is being
done on a per-site basis, socket pooling will need to be disabled.
To disable socket pooling, perform the following steps:
cscript adsutil.vbs set w3svc/disablesocketpooling true
The command replies as follows:
disablesocketpooling : (BOOLEAN) True
Stop and start the IISAdmin service.
Restart the WWW service.

Once you do this, you can have both IIS and Apache/Tomcat listening on port
80 on different IPs on the same machine.  No need for multiple nic's and
multiple network segments either.

hope this helps,
began

- Original Message -
From: Robert L Sowders [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, October 26, 2002 5:24 AM
Subject: Re: Tomcat 4.1.12 taking IPs or Ports not assigned to it?


 It's by design.

 Try using two nic's on different subnets.  Say 1.2.3.4 and 1.2.4.4.

 rls





 Nathan Phelps [EMAIL PROTECTED]
 10/25/2002 12:20 PM
 Please respond to Tomcat Users List


 To: '[EMAIL PROTECTED]'
[EMAIL PROTECTED]
 cc:
 Subject:Tomcat 4.1.12 taking IPs or Ports not assigned to
it?


 EXECUTIVE SUMMARY:
   - Single Windows 2000 (SP3) Server with JDK 1.4.1_01
   - Running IIS 5.0 and Tomcat 4.1.12
   - Two IP addresses assigned to a single NIC (1.2.3.4, and 1.2.3.5 for
 example)
   - IIS has one website (all other websites have been stopped) assigned to
 1.2.3.4:80
   - Tomcat has one website assigned to 1.2.3.5:80
   - If Tomcat is started after IIS, Tomcat reports
 java.net.BindException:
 Address already in use: JVM_Bind:80
   - If Tomcat is started before IIS, IIS reports Address already in use
   - Tomcat server.xml file is included at bottom.

 MORE DETAILS:
 I have a Windows 2000 Server (SP3) with IIS 5.0 and Tomcat 4.1.12
 installed
 using JDK 1.4.1_01.  The machine has two static IPs assigned to it (I'll
 use
 1.2.3.4, and 1.2.3.5 for examples) and the IIS website is configured to
 use
 one of these address at port 80 (1.2.3.4).  The default Tomcat HTTP1.1
 connector has been updated and the configuration file has been modified by
 adding the address attribute and assigning the other IP (1.2.3.5) to it.
 The port attribute has been modified to port 80.

 When I try and start Tomcat, it reports that the address is already in
 use.
 However, I have verified that it is indeed NOT in use.  I have verified
 this
 assumption by creating an additional IIS website and assigning it to the
 IP
 I had assigned to the Tomcat connector (1.2.3.5) as well as to port 80.  I
 can start both IIS websites (1.2.3.4:80 and 1.2.3.5:80) and access them
 both
 with the correct IPs.

 An additional test I conducted was to stop all IIS websites, and then
 start
 Tomcat on its previously assigned IP (1.2.3.5) on port 80.  It started
 successfully and could be accessed.  Then, however, I tried to start the
 original IIS website (on 1.2.3.4), and it failed to start reporting the
 address was in use.  The ONLY way I could get them both running was to
 assign them different port numbers (which sort of eliminates the whole
 purpose of having two different IPs in the first place).  How can I fix
 this
 issue?

 TOMCAT CONFIGURATION FILE:
 My configuration file (with the sample IP and comments removed) looks like
 this:

 Server port=8005 shutdown=SHUTDOWN debug=0
   Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
 debug=0 port=-1 login=admin password=admin/

   Service name=Tomcat-Standalone

 Connector className=org.apache.coyote.tomcat4.CoyoteConnector
port=80 minProcessors=5 maxProcessors=75
enableLookups=true redirectPort=8443
acceptCount=10 debug=0 connectionTimeout=6
 address=1.2.3.5/

 Engine name=Standalone defaultHost=localhost debug=0

   Logger className=org.apache.catalina.logger.FileLogger
   prefix=catalina_log. suffix=.txt
   timestamp=true/

   Realm

Tomcat 4.1.12 taking IPs or Ports not assigned to it?

2002-10-26 Thread Nathan Phelps

EXECUTIVE SUMMARY:
  - Single Windows 2000 (SP3) Server with JDK 1.4.1_01
  - Running IIS 5.0 and Tomcat 4.1.12
  - Two IP addresses assigned to a single NIC (1.2.3.4, and 1.2.3.5 for
example)
  - IIS has one website (all other websites have been stopped) assigned to
1.2.3.4:80 
  - Tomcat has one website assigned to 1.2.3.5:80
  - If Tomcat is started after IIS, Tomcat reports java.net.BindException:
Address already in use: JVM_Bind:80
  - If Tomcat is started before IIS, IIS reports Address already in use
  - Tomcat server.xml file is included at bottom.

MORE DETAILS:
I have a Windows 2000 Server (SP3) with IIS 5.0 and Tomcat 4.1.12 installed
using JDK 1.4.1_01.  The machine has two static IPs assigned to it (I'll use
1.2.3.4, and 1.2.3.5 for examples) and the IIS website is configured to use
one of these address at port 80 (1.2.3.4).  The default Tomcat HTTP1.1
connector has been updated and the configuration file has been modified by
adding the address attribute and assigning the other IP (1.2.3.5) to it.
The port attribute has been modified to port 80.

When I try and start Tomcat, it reports that the address is already in use.
However, I have verified that it is indeed NOT in use.  I have verified this
assumption by creating an additional IIS website and assigning it to the IP
I had assigned to the Tomcat connector (1.2.3.5) as well as to port 80.  I
can start both IIS websites (1.2.3.4:80 and 1.2.3.5:80) and access them both
with the correct IPs.

An additional test I conducted was to stop all IIS websites, and then start
Tomcat on its previously assigned IP (1.2.3.5) on port 80.  It started
successfully and could be accessed.  Then, however, I tried to start the
original IIS website (on 1.2.3.4), and it failed to start reporting the
address was in use.  The ONLY way I could get them both running was to
assign them different port numbers (which sort of eliminates the whole
purpose of having two different IPs in the first place).  How can I fix this
issue?

TOMCAT CONFIGURATION FILE:
My configuration file (with the sample IP and comments removed) looks like
this:

Server port=8005 shutdown=SHUTDOWN debug=0
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
debug=0 port=-1 login=admin password=admin/

  Service name=Tomcat-Standalone

Connector className=org.apache.coyote.tomcat4.CoyoteConnector
   port=80 minProcessors=5 maxProcessors=75
   enableLookups=true redirectPort=8443
   acceptCount=10 debug=0 connectionTimeout=6
address=1.2.3.5/

Engine name=Standalone defaultHost=localhost debug=0

  Logger className=org.apache.catalina.logger.FileLogger
  prefix=catalina_log. suffix=.txt
  timestamp=true/

  Realm className=org.apache.catalina.realm.MemoryRealm /

  Host name=localhost debug=0 appBase=webapps 
   unpackWARs=true autoDeploy=true

Valve className=org.apache.catalina.valves.AccessLogValve
 directory=logs  prefix=localhost_access_log.
suffix=.txt
 pattern=common/

Logger className=org.apache.catalina.logger.FileLogger
 directory=logs  prefix=localhost_log. suffix=.txt
timestamp=true/
  /Host

/Engine

  /Service

/Server



--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Tomcat 4.1.12 taking IPs or Ports not assigned to it?

2002-10-26 Thread Robert L Sowders
It's by design. 

Try using two nic's on different subnets.  Say 1.2.3.4 and 1.2.4.4.

rls





Nathan Phelps [EMAIL PROTECTED]
10/25/2002 12:20 PM
Please respond to Tomcat Users List

 
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
cc: 
Subject:Tomcat 4.1.12 taking IPs or Ports not assigned to it?


EXECUTIVE SUMMARY:
  - Single Windows 2000 (SP3) Server with JDK 1.4.1_01
  - Running IIS 5.0 and Tomcat 4.1.12
  - Two IP addresses assigned to a single NIC (1.2.3.4, and 1.2.3.5 for
example)
  - IIS has one website (all other websites have been stopped) assigned to
1.2.3.4:80 
  - Tomcat has one website assigned to 1.2.3.5:80
  - If Tomcat is started after IIS, Tomcat reports 
java.net.BindException:
Address already in use: JVM_Bind:80
  - If Tomcat is started before IIS, IIS reports Address already in use
  - Tomcat server.xml file is included at bottom.

MORE DETAILS:
I have a Windows 2000 Server (SP3) with IIS 5.0 and Tomcat 4.1.12 
installed
using JDK 1.4.1_01.  The machine has two static IPs assigned to it (I'll 
use
1.2.3.4, and 1.2.3.5 for examples) and the IIS website is configured to 
use
one of these address at port 80 (1.2.3.4).  The default Tomcat HTTP1.1
connector has been updated and the configuration file has been modified by
adding the address attribute and assigning the other IP (1.2.3.5) to it.
The port attribute has been modified to port 80.

When I try and start Tomcat, it reports that the address is already in 
use.
However, I have verified that it is indeed NOT in use.  I have verified 
this
assumption by creating an additional IIS website and assigning it to the 
IP
I had assigned to the Tomcat connector (1.2.3.5) as well as to port 80.  I
can start both IIS websites (1.2.3.4:80 and 1.2.3.5:80) and access them 
both
with the correct IPs.

An additional test I conducted was to stop all IIS websites, and then 
start
Tomcat on its previously assigned IP (1.2.3.5) on port 80.  It started
successfully and could be accessed.  Then, however, I tried to start the
original IIS website (on 1.2.3.4), and it failed to start reporting the
address was in use.  The ONLY way I could get them both running was to
assign them different port numbers (which sort of eliminates the whole
purpose of having two different IPs in the first place).  How can I fix 
this
issue?

TOMCAT CONFIGURATION FILE:
My configuration file (with the sample IP and comments removed) looks like
this:

Server port=8005 shutdown=SHUTDOWN debug=0
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
debug=0 port=-1 login=admin password=admin/

  Service name=Tomcat-Standalone

Connector className=org.apache.coyote.tomcat4.CoyoteConnector
   port=80 minProcessors=5 maxProcessors=75
   enableLookups=true redirectPort=8443
   acceptCount=10 debug=0 connectionTimeout=6
address=1.2.3.5/

Engine name=Standalone defaultHost=localhost debug=0

  Logger className=org.apache.catalina.logger.FileLogger
  prefix=catalina_log. suffix=.txt
  timestamp=true/

  Realm className=org.apache.catalina.realm.MemoryRealm /

  Host name=localhost debug=0 appBase=webapps 
   unpackWARs=true autoDeploy=true

Valve className=org.apache.catalina.valves.AccessLogValve
 directory=logs  prefix=localhost_access_log.
suffix=.txt
 pattern=common/

Logger className=org.apache.catalina.logger.FileLogger
 directory=logs  prefix=localhost_log. suffix=.txt
 timestamp=true/
  /Host

/Engine

  /Service

/Server



--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org





--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org