Re: listening on port 80 as a non root user

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: listening on port 80 as a non root user

Chris Haynes
Use the

   setPort(80)

 API call in your Socket Listener - you can do this in your XML config file
alongside the setting of threads and max idle time.

Chris Haynes

"Simon Lambert" asked


> Hi,
> sorry if this is a question that has been asked a million times before - I
have
> had a good search around, and can't seem to find the answer.
>
> I am running Jetty-4.2.15 as a non root user listening on port 8080.  I am
using

> iptables to redirect incoming requests on port 80 to 8080 (see below for
> iptables config).
>
> The problem that I face is when the browser displays a page requested via port
> 80, the real port (8080) is displayed in the browser, so when making a request
> to http://somehost/foo.jsp the url becomes http://somehost:8080/foo.jsp
>
> Is there a way to prevent this?
>
> Thanks for any help - it is much appreciated.
>
> Simon.
>
>
> ------------------------
> iptables config:
>
> -A PREROUTING -d 192.168.0.100 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports
> 8080
> -A OUTPUT -d 127.0.0.1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
> -A OUTPUT -d 192.160.0.100 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports
8080
>
> -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
> -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j
ACCEPT
> -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j
ACCEPT
> -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8443 -j
ACCEPT
>




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support