Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start Jetty from command line with different ports for http and https

I already use -Djetty.port=xxx to set the http port on command line but I also need to specify a different port for https. I got some hints online about jetty.ssl.port and aleady tried -Djetty.ssl.port=yyy but that did not work.

As to why provide ports on command line versus the config xml file, it's because depending on some conditions I need to start Jetty on certain ports.

I'm using Jetty 6.1-SNAPSHOT.

Ultimately I need something like: java -Djetty.port=XXX -Djetty.ssl.port=YYY -jar start.jar

like image 968
pashgol pashgolian Avatar asked Sep 18 '25 08:09

pashgol pashgolian


1 Answers

Note...that is really old version of jetty, we are releasing milestones for jetty 9 today even.

regardless, look in the jetty.xml and you should see where there is a property defined for jetty.port, just make a similar property for jetty.ssl.port or the like and then use that.

the jetty.xml file should be very easy to read, though thinking back you might need to look in the jetty-ssl.xml file.

like image 88
jesse mcconnell Avatar answered Sep 19 '25 23:09

jesse mcconnell