4

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?).

shaond
  • 141
  • 5

1 Answers1

1

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

eg:

export JETTY_PORT=20000

Then launch the application.

justinhj
  • 213
  • 1
  • 3
  • 8
  • 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