Jetty default port is 8080, but I want to change to default port to some other port (9999).
I read a few tutorials and they said almost all of configuration informa
On jetty 9.2.3.v20140905 it`s need to write in /etc/default/jetty
# JETTY_ARGS
# The default arguments to pass to jetty.
# For example
JETTY_ARGS="jetty.port=8080 jetty.spdy.port=8443 jetty.secure.port=443"
but this change only http port. To change https port in jetty 9.2 create ini file $JETTY_HOME/start.d/https.ini
# Initialize module https
#
--module=https
## HTTPS Configuration
# HTTP port to listen on
https.port=8443
# HTTPS idle timeout in milliseconds
https.timeout=30000
# HTTPS Socket.soLingerTime in seconds. (-1 to disable)
# https.soLingerTime=-1
jetty 9.3 in /etc/default/jetty
# JETTY_ARGS
# The default arguments to pass to jetty.
# For example
JETTY_ARGS="jetty.http.port=8080 jetty.ssl.port=443"
or command line parameters -Djetty.http.port=8080 -Djetty.ssl.port=443
For SSL port you can pass the param:
-Dssl.port=8445
It worked for me.
does it work if you set the port when you start it from the command line like this:
java -jar start.jar -Djetty.port=9999
I did this in Jetty 9.x version.
You need to go to $JETTY_HOME/start.ini
file and edit this setting jetty.port.
Lets say that you want to run jetty at 9090 port:
Please change jetty.port
setting in $JETTY_HOME/start.ini
from
jetty.port=8080
to
jetty.port=9090
Then start jetty using java -jar start.jar
option.
Then jetty will be running at 9090 port than default 8080 port.
Then do curl -i -XGET "http://localhost:9090"
. That should give you 200 http status.
Thats it.