View previous topic :: View next topic |
Author |
Message |
stig Apprentice
Joined: 03 Sep 2002 Posts: 289 Location: Bærum, Norway
|
Posted: Mon Oct 11, 2004 9:59 pm Post subject: tomcat5 on port 80 |
|
|
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 |
|
|
Voltago Advocate
Joined: 02 Sep 2003 Posts: 2593 Location: userland
|
Posted: Mon Oct 11, 2004 10:07 pm Post subject: |
|
|
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 |
|
|
stig Apprentice
Joined: 03 Sep 2002 Posts: 289 Location: Bærum, Norway
|
Posted: Mon Oct 11, 2004 10:18 pm Post subject: |
|
|
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 |
|
|
Voltago Advocate
Joined: 02 Sep 2003 Posts: 2593 Location: userland
|
Posted: Mon Oct 11, 2004 10:21 pm Post subject: |
|
|
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 |
|
|
grapeman n00b
Joined: 11 Oct 2004 Posts: 10
|
Posted: Mon Oct 11, 2004 10:22 pm Post subject: Ha, been there |
|
|
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 |
|
|
stig Apprentice
Joined: 03 Sep 2002 Posts: 289 Location: Bærum, Norway
|
Posted: Mon Oct 11, 2004 10:27 pm Post subject: |
|
|
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 |
|
|
|