last day (34 days later) » 

9:45 PM
1
A: Jetty: Hide port number in the URL

Sergey BrunovIf I understand the problem correctly, you need to use the 80 port as the Jetty's one (jetty.http.port), because http://test.com/ means that the port is the default — 80. Additional references: networking - Why was port 80 chosen as the default HTTP port and 443 as the default HTTPS port? - Su...

 
Bob
This is was I tried and describe in the post. This is not deleting the :8080 in the URL.
 
@Bob, could you please update the question by adding a Minimal, Complete, and Verifiable example, including the content of the pom.xml file?
 
Bob
I added the pom.xml.
 
@Bob, good. What about the Java source code?
 
Bob
I don't think it's in my java code... and my code contain huge lines. I think it's in maven or jetty configuration
 
9:45 PM
@Bob, it would be great, if you could provide a minimal, but complete example to reproduce the problem.
 
Bob
Hello Sergey, I created a discussion
I'm sorry, I don't know how I can provide more.. I installed Jetty 9 on a debian
then I deploied my war on it and I tried to access it by using my domainname.com
I can only access to it by doing domainname.com:8080
 
10:19 PM
Hi, @Bob!
Just a minute, please.
 
10:40 PM
Please read the note to the end, before making any changes.

# How to change the port?

Edit the file:

# nano /etc/default/jetty9

as follows:

# Additional arguments to pass to Jetty
JETTY_ARGS=jetty.port=80

After that, restart the Jetty server:

# service jetty9 restart

You should receive the error in the log file (by default, log files are here: `/var/log/jetty9`) like:

> 2017-11-18 01:27:58.214:WARN:oejuc.AbstractLifeCycle:main: FAILED ServerConnector@1ed1993a{HTTP/1.1}{0.0.0.0:80}: java.net.SocketException: Permission denied
@Bob, please let me know, what do you think about these findings?
@Bob, I have just found how to open the 80 port under a non-root user.
The previous instruction (the «How to change the port?» section) is a prerequisite.

Edit the file:

# nano /etc/default/jetty9

as follows (see at the end of the file):

# If you run Jetty on port numbers that are all higher than 1023, then you
# do not need authbind. It is used for binding Jetty to lower port numbers.
# (yes/no, default: no)
AUTHBIND=yes

After that, restart the Jetty server:

# service jetty9 restart
@Bob, please let me know your result, so that I will update the answer based on it.
 

  last day (34 days later) »