You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Craig <Ta...@Colorado.EDU> on 2005/04/26 12:18:20 UTC

Problem Binding Tomcat to Ports 80/443

Hey Tomcat Users!

I am having  a very desperate problem with Tomcat.  I have a demonstration
due later today, and the script I have been using to run tomcat (5.0.27)
on ports 80/443 doesn't seem to do the job -- though it had been
workingfor weeks up until a restart earlier today.  I'm getting these
kinds of errors in catalina.out when I try to start it on port 80/443:

Apr 26, 2005 1:23:55 AM org.apache.coyote.tomcat5.CoyoteConnector pause
SEVERE: Protocol handler pause failed
java.lang.NullPointerException

...

Apr 26, 2005 1:24:04 AM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.BindException: Permission denied:80

I don't have anything running on ports 80 or 443, as a netstat -ltun
shows:

# netstat -ltun
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:8005          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:7144            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:873             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:7145            0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN
tcp        0      0 66.93.121.250:53        0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8086            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN
udp        0      0 0.0.0.0:32768           0.0.0.0:*
udp        0      0 66.93.121.250:53        0.0.0.0:*
udp        0      0 127.0.0.1:53            0.0.0.0:*


The connectors in my server.xml look like this:


    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 80 -->
    <Connector port="8086"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" acceptCount="100"
               debug="0" connectionTimeout="20000"
               disableUploadTimeout="true" redirectPort="443" />

   <!-- Define a SSL Coyote HTTP/1.1 Connector on port 443 -->
    <Connector port="443"
               minProcessors="5" maxProcessors="75"
               enableLookups="true" disableUploadTimeout="true"
               acceptCount="100" debug="0" scheme="https" secure="true"
               clientAuth="false" sslProtocal="TLS"
               keystoreFile="/home/tomcat/.keystore" keystorepass="xxxxxx"
               keystoreType="JKS" />

I get the same problem using the Tomcat5.sh jsvc script modified for my
installation as I do when I try to run tomcat as root!

It's like something has mysterously taken over ports 80/443 and won't tell
me about it or give them back!

Any suggestions?


- Craig
"Ne te quaesiveris extra."


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


Re: Problem Binding Tomcat to Ports 80/443

Posted by Parsons Technical Services <pa...@earthlink.net>.
Check to see if Tomcat is already running. Also the config you posted has 
the port at 8086. And something is listening on 8086.

Do a reboot and look at your processes and netstat before doing anything 
else. Then take it from there.

Doug

----- Original Message ----- 
From: "Craig" <Ta...@Colorado.EDU>
To: <to...@jakarta.apache.org>
Sent: Tuesday, April 26, 2005 6:18 AM
Subject: Problem Binding Tomcat to Ports 80/443


> Hey Tomcat Users!
>
> I am having  a very desperate problem with Tomcat.  I have a demonstration
> due later today, and the script I have been using to run tomcat (5.0.27)
> on ports 80/443 doesn't seem to do the job -- though it had been
> workingfor weeks up until a restart earlier today.  I'm getting these
> kinds of errors in catalina.out when I try to start it on port 80/443:
>
> Apr 26, 2005 1:23:55 AM org.apache.coyote.tomcat5.CoyoteConnector pause
> SEVERE: Protocol handler pause failed
> java.lang.NullPointerException
>
> ...
>
> Apr 26, 2005 1:24:04 AM org.apache.coyote.http11.Http11Protocol init
> SEVERE: Error initializing endpoint
> java.net.BindException: Permission denied:80
>
> I don't have anything running on ports 80 or 443, as a netstat -ltun
> shows:
>
> # netstat -ltun
> Active Internet connections (only servers)
> Proto Recv-Q Send-Q Local Address           Foreign Address         State
> tcp        0      0 127.0.0.1:8005          0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:7144            0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:873             0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:7145            0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN
> tcp        0      0 66.93.121.250:53        0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:8086            0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN
> udp        0      0 0.0.0.0:32768           0.0.0.0:*
> udp        0      0 66.93.121.250:53        0.0.0.0:*
> udp        0      0 127.0.0.1:53            0.0.0.0:*
>
>
> The connectors in my server.xml look like this:
>
>
>    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 80 -->
>    <Connector port="8086"
>               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
>               enableLookups="false" acceptCount="100"
>               debug="0" connectionTimeout="20000"
>               disableUploadTimeout="true" redirectPort="443" />
>
>   <!-- Define a SSL Coyote HTTP/1.1 Connector on port 443 -->
>    <Connector port="443"
>               minProcessors="5" maxProcessors="75"
>               enableLookups="true" disableUploadTimeout="true"
>               acceptCount="100" debug="0" scheme="https" secure="true"
>               clientAuth="false" sslProtocal="TLS"
>               keystoreFile="/home/tomcat/.keystore" keystorepass="xxxxxx"
>               keystoreType="JKS" />
>
> I get the same problem using the Tomcat5.sh jsvc script modified for my
> installation as I do when I try to run tomcat as root!
>
> It's like something has mysterously taken over ports 80/443 and won't tell
> me about it or give them back!
>
> Any suggestions?
>
>
> - Craig
> "Ne te quaesiveris extra."
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> 



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


Re: Problem Binding Tomcat to Ports 80/443

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
Craig wrote:

>Hey Tomcat Users!
>
>I am having  a very desperate problem with Tomcat.  I have a demonstration
>due later today, and the script I have been using to run tomcat (5.0.27)
>on ports 80/443 doesn't seem to do the job -- though it had been
>workingfor weeks up until a restart earlier today.  I'm getting these
>kinds of errors in catalina.out when I try to start it on port 80/443:
>
>Apr 26, 2005 1:23:55 AM org.apache.coyote.tomcat5.CoyoteConnector pause
>SEVERE: Protocol handler pause failed
>java.lang.NullPointerException
>
>...
>
>Apr 26, 2005 1:24:04 AM org.apache.coyote.http11.Http11Protocol init
>SEVERE: Error initializing endpoint
>java.net.BindException: Permission denied:80
>
>I don't have anything running on ports 80 or 443, as a netstat -ltun
>shows:
>  
>

Then you're running TC as an unprivileged user (tomcat4 or tomcat5) and 
only superuser can bind to ports < 1024. Or, as a long shot, maybe 
you've enabled security, but TC should be able to bind to 80/443 with 
default security setup.

Anyway, I suspect it is the unprivileged user issue. It can be resolved 
in three ways.

1. Run TC behind Apache, which would run on ports 80/443 and TC would be 
connected via mod_jk (or mod_jk2, if you're sentimental/more adapt to it)

2. Run TC as "root", since it is a demonstration, that additional risk 
is not going to kill you, but it is definitely not for production.

3. Run TC via Jakarta-Commons Daemon and it's JSVC

Solution No2 is the fastest, try it out and if it works, you can calm 
down and play with the other two.

Nix.

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