Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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&gt; ?

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

share|improve this question

1 Answer 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.

share|improve this answer
    
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
    
Any application needs to run as root to listen on port 80 –  justinhj Mar 18 '11 at 21:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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