Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
tomcat5 on port 80
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
stig
Apprentice
Apprentice


Joined: 03 Sep 2002
Posts: 289
Location: Bærum, Norway

PostPosted: Mon Oct 11, 2004 9:59 pm    Post subject: tomcat5 on port 80 Reply with quote

I've just re-installed one of my boxes, and now I'm having a bit of trouble getting Tomcat to run at port 80.
Changing the '8080' to '80' in /etc/tomcat5/server.xml results in 'connection refused' when connecting, thus the port is not opened.
I recon it has something to do with the startupscript, and that Tomcat is running as a regular user?
_________________
Allting har en ende, pølsen den har to.
Back to top
View user's profile Send private message
Voltago
Advocate
Advocate


Joined: 02 Sep 2003
Posts: 2593
Location: userland

PostPosted: Mon Oct 11, 2004 10:07 pm    Post subject: Reply with quote

What do tomcat's logfiles tell you? Btw, port 80 can only be opened by processes with root privileges. Which user is running tomcat?
Back to top
View user's profile Send private message
stig
Apprentice
Apprentice


Joined: 03 Sep 2002
Posts: 289
Location: Bærum, Norway

PostPosted: Mon Oct 11, 2004 10:18 pm    Post subject: Reply with quote

catalina.out states (not unexpectedly)
Code:
java.net.BindException: Permission denied:80

I've just emerged tomcat5, and the startupscript makes it run as a "tomcat"-user.
_________________
Allting har en ende, pølsen den har to.
Back to top
View user's profile Send private message
Voltago
Advocate
Advocate


Joined: 02 Sep 2003
Posts: 2593
Location: userland

PostPosted: Mon Oct 11, 2004 10:21 pm    Post subject: Reply with quote

Ok, your options are:
1) Forward all traffic from port 80 to 8080 with iptables
2) Use root to run tomcat or give tomcat root permissions (*cough*badidea*cough*)
Back to top
View user's profile Send private message
grapeman
n00b
n00b


Joined: 11 Oct 2004
Posts: 10

PostPosted: Mon Oct 11, 2004 10:22 pm    Post subject: Ha, been there Reply with quote

Unless you run Tomcat as root, you cannot run tomcat on port 80.. most people don't recommend.. so that's ur first option

the other option is to use either iptables or shorewall(much easier) and rout port 80 over to port 8080, that's what I do and it works great
_________________
Vnl Online
http://vnl-online.com
Back to top
View user's profile Send private message
stig
Apprentice
Apprentice


Joined: 03 Sep 2002
Posts: 289
Location: Bærum, Norway

PostPosted: Mon Oct 11, 2004 10:27 pm    Post subject: Reply with quote

Thanks for your quick responses, I'll get hacking on iptables at once!
Am I totally not near at all with this?
Code:
iptables -t nat -A PREROUTING -i ! lo -p tcp --dport 80 -j REDIRECT --to-ports 8080

_________________
Allting har en ende, pølsen den har to.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum