port 80 not open for jetty?
Posted on 2005-03-31
I'm trying to get the Jetty application server running on port 80. I found that if I run it as root then it works fine. If I run it as a different user I created (who I called "jetty") then it gives bind exceptions when starting up.
If I change it to use port 8080 and run it as user "jetty" then it works fine.
I found a message where they said I could map 8080 to 80 by doing:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
That almost works (although I fail to see why I can't just run on port 80 directly). When I start up jetty it binds to port 8080 and then when, from another machine, I go to the server on port 80 then it serves up web pages fine. But, when I hit a servlet that attempts to connect to port 80 then it doesn't work.
In other words, it works fine to hit the server's port 80 from an external machine, but when code running under jetty attempts to hit port 80 (by making a direct http get to the server it's running on) then it says "Connection refused".