How to bind Tomcat to Port 80

hello Fellow Linode users,

I have just installed Tomcat on my Linode. When I try to bind it to port 80, I get below error

java.net.BindException: Permission denied :80

I am sure it may be an issue of having another program using port 80 or I don't have enough permissions. But I logged in as root user, so it shouldn't be a problem.

Any hint is much appreciated.

cheers

4 Replies

# netstat -nap | grep ':80' | grep LISTEN

do you really want tomcat listening to 80? Usually you setup a real webserver in front of it.

Thanks glg/rsk.

Yeah. I can configure iptables to direct all traffic on port 80 to tomcat port.

I google and found this if anybody wants to bind it to port 80

Yeah you are right. I dont need to bind it to port 80, I can configure my iptable to redirect all traffic on 80 to tomcat port.

If at all we want to bind to 80, this link may help.

http://thelowedown.wordpress.com/2010/0 … ianubuntu/">http://thelowedown.wordpress.com/2010/08/17/tomcat-6-binding-to-a-privileged-port-on-debianubuntu/

I wasn't talking about iptables. I'm talking about putting up apache or nginx or something else in front of it. Tomcat isn't meant to be a front end web server, it's an application server.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct