I'm brand new to Jetty.

I'd like to ask if its possible to have Jetty listening on port 8080, however where specified, serve a specific web application under say /var/jetty/webapps/<appname> (default on CentOS) served on say port 10000 instead of http://localhost:8080/<appname> i.e. http://localhost:10000/ = http://localhost:8080/<appname> ?

If so, what configuration changes would be required to make this work without an additional proxy server? I've googled away, but haven't found a solution (perhaps I've missed something obvious?).


You can change the port on a linux deployment using the environment variable JETTY_PORT.


export JETTY_PORT=20000

Then launch the application.

  • This doesn't work for me. Jetty is listening on 8080 per default. I set JETTY_PORT=80 in the config file and then restarted Jetty, but it doesn't listen on port 80. – Jonas Mar 18 '11 at 12:59
  • On Linux? Just tried it and it worked fine. Centos OS with Jetty6. Try this and see what JETTY_PORT is set to, perhaps someone is setting in by hacking the jetty.sh file? "sh ./bin/jetty.sh check" – justinhj Mar 18 '11 at 18:25
  • Yes it worked with that port on Linux, but not with port 80. It seems like Jetty needs to be run as root to be able to listen on port 80. Thansk anyway. – Jonas Mar 18 '11 at 18:34
  • 1
    Any application needs to run as root to listen on port 80 – justinhj Mar 18 '11 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.