You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thomas Hartwig <t....@itth.com> on 2005/12/07 00:13:44 UTC

apr port + tomcat

Hello,

I try to use the APR (1.2.2) in conjunction with tomcat 5.5.12 and 
tomcat-native-1.1.0. All works fine except one thing: I can only use it 
with root privileges, because the tomcat connector wants to establish 
the port 98 for its communication (see stacktrace below).
I have not found a possibility to change this behaviour, do you have an 
idea how to reconfigure this port? For security reasons I would like to 
run tomcat under an unprivileged user.

Thanks
Thomas

java.lang.Exception: Socket bind failed: 98
         at 
org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:544)
         at 
org.apache.coyote.ajp.AjpAprProtocol.init(AjpAprProtocol.java:183)
         at 
org.apache.catalina.connector.Connector.initialize(Connector.java:1016)
         at 
org.apache.catalina.core.StandardService.initialize(StandardService.java:580)
         at 
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:762)
         at org.apache.catalina.startup.Catalina.load(Catalina.java:488)
         at org.apache.catalina.startup.Catalina.load(Catalina.java:508)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:247)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
06.12.2005 23:30:52 org.apache.catalina.startup.Catalina load
SCHWERWIEGEND: Catalina.start
LifecycleException:  Protocol handler initialization failed: 
java.lang.Exception: Socket bind failed: 98
         at 
org.apache.catalina.connector.Connector.initialize(Connector.java:1018)
         at 
org.apache.catalina.core.StandardService.initialize(StandardService.java:580)
         at 
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:762)
         at org.apache.catalina.startup.Catalina.load(Catalina.java:488)
         at org.apache.catalina.startup.Catalina.load(Catalina.java:508)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:247)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apr port + tomcat

Posted by Thomas Hartwig <t....@itth.com>.
Strangely it is working now without any changes, perhaps there was some 
old process blocking the port.

Thomas

Thomas Hartwig wrote:
> Hello,
> 
> I try to use the APR (1.2.2) in conjunction with tomcat 5.5.12 and 
> tomcat-native-1.1.0. All works fine except one thing: I can only use it 
> with root privileges, because the tomcat connector wants to establish 
> the port 98 for its communication (see stacktrace below).
> I have not found a possibility to change this behaviour, do you have an 
> idea how to reconfigure this port? For security reasons I would like to 
> run tomcat under an unprivileged user.
> 
> Thanks
> Thomas
> 
> java.lang.Exception: Socket bind failed: 98
>         at 
> org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:544)
>         at 
> org.apache.coyote.ajp.AjpAprProtocol.init(AjpAprProtocol.java:183)
>         at 
> org.apache.catalina.connector.Connector.initialize(Connector.java:1016)
>         at 
> org.apache.catalina.core.StandardService.initialize(StandardService.java:580) 
> 
>         at 
> org.apache.catalina.core.StandardServer.initialize(StandardServer.java:762)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:488)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:508)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
> 
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:247)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
> 06.12.2005 23:30:52 org.apache.catalina.startup.Catalina load
> SCHWERWIEGEND: Catalina.start
> LifecycleException:  Protocol handler initialization failed: 
> java.lang.Exception: Socket bind failed: 98
>         at 
> org.apache.catalina.connector.Connector.initialize(Connector.java:1018)
>         at 
> org.apache.catalina.core.StandardService.initialize(StandardService.java:580) 
> 
>         at 
> org.apache.catalina.core.StandardServer.initialize(StandardServer.java:762)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:488)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:508)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
> 
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:247)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apr port + tomcat

Posted by Aurélien DEHAY <ad...@zorel.org>.
Aurélien DEHAY wrote:
> Hello.
> 
> Mladen Turk wrote:
> 
>>
>> The reason is probably because either real port (8080) is in use
>> or the previous Tomcat version was shut down improperly.
>> Wait a wile (cca 240 sec) until the OS recycles the zombie descriptor.
> 
> 
> Ok, I'll check that, thank you.

Works fine. Very fine. A huge thanks.

Aurélien

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apr port + tomcat

Posted by Aurélien DEHAY <ad...@zorel.org>.
Hello.

Mladen Turk wrote:
> Aurélien DEHAY wrote:
> 
>>
>> I've exactly the same stack. No process is using port 98, but as I'm 
>> not  a root user, I can't bind on this address.
>>
> 
> This message (98) is APR OS error (EADDRINUSE).
> Tomcat has been changed to display the real message (5.5.13+)
> instead the OS errno.
> 
>> I don't wan't to start the server as Root, I will double check the 
>> docs to see if I've forgot something, but if someone has the answer...
>>
> 
> The reason is probably because either real port (8080) is in use
> or the previous Tomcat version was shut down improperly.
> Wait a wile (cca 240 sec) until the OS recycles the zombie descriptor.

Ok, I'll check that, thank you.

> 
> Regards,
> Mladen.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apr port + tomcat

Posted by Mladen Turk <ml...@jboss.com>.
Aurélien DEHAY wrote:
> 
> I've exactly the same stack. No process is using port 98, but as I'm not 
>  a root user, I can't bind on this address.
> 

This message (98) is APR OS error (EADDRINUSE).
Tomcat has been changed to display the real message (5.5.13+)
instead the OS errno.

> I don't wan't to start the server as Root, I will double check the docs 
> to see if I've forgot something, but if someone has the answer...
> 

The reason is probably because either real port (8080) is in use
or the previous Tomcat version was shut down improperly.
Wait a wile (cca 240 sec) until the OS recycles the zombie descriptor.

Regards,
Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apr port + tomcat

Posted by Aurélien DEHAY <ad...@zorel.org>.
Thomas Hartwig wrote:
> Hello,
> 
> I try to use the APR (1.2.2) in conjunction with tomcat 5.5.12 and 
> tomcat-native-1.1.0. All works fine except one thing: I can only use it 
> with root privileges, because the tomcat connector wants to establish 
> the port 98 for its communication (see stacktrace below).
> I have not found a possibility to change this behaviour, do you have an 
> idea how to reconfigure this port? For security reasons I would like to 
> run tomcat under an unprivileged user.

Hello.

I've exactly the same stack. No process is using port 98, but as I'm not 
  a root user, I can't bind on this address.

I don't wan't to start the server as Root, I will double check the docs 
to see if I've forgot something, but if someone has the answer...

best regards.
Aurélien

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org