Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] How to Jetty server listen on multiple IP addresses

I'm not sure what you mean by bullet 6... how do you add the XML to
the *.ini file?
You meant *.mod?
Sorry for the confusion. I was referring to adding the XML file path into ssl.ini, i.e.
cat jetty_base/start.d/https.ini 
# --------------------------------------- 
# Module: https
# Adds HTTPS protocol support to the TLS(SSL) Connector
# --------------------------------------- 
--module=https

etc/jetty-https-2.xml

Rather than modifying existing Jetty files, I would just create a new
module with a different name.
I would copy `jetty-ssl.xml` and `jetty-https.xml` into another file
called, say, `acme-extra-ssl.xml`.
Then create a module called `acme-extra-ssl.mod`, referencing the new XML.
And then start Jetty with the new module.
Thanks for the detailed instructions! This customized module approach sounds very similar to my local try, despite that I didn't wrap it as a new module.

Upon reviewing the resource you shared, I now have a clearer understanding of when a customized module is necessary. It seems that creating a custom module is the preferred method when the modification of existing parameters does not suffice.

Best,
Yicheng

On Tue, May 16, 2023 at 1:58 AM Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
Hi,

On Mon, May 15, 2023 at 8:16 PM Wang Yicheng <wangyicheng1209@xxxxxxxxx> wrote:
>
> Hi Simone,
>
> I'm chasing the same problem as the original post. And inspired by Uwe's reply, I managed to get it to work by duplicating the "connector" instantiation code in jetty-ssl.xml and creating 2 jetty-https.xml files (please see my detailed steps below). This seems to work perfectly, but I'm just curious about how my solution differs from yours. Is better encapsulation the only difference here by creating a customized module? Many thanks in advance!
>
> 1. Copy over jetty-ssl.xml from ${JETTY_HOME}/etc to${JETTY_BASE}/etc
> 2. Duplicate the “addConnector” block so that 2 connectors will be created
> 3. Copy over jetty-https.xml from ${JETTY_HOME}/etc to ${JETTY_BASE}/etc
> 4. Duplicate jetty-https.xml to correspond to the 2 connectors. Say the second XML is named as jetty-https-2.xml
> 5. Update the connector ID field in jetty-https.xml files accordingly
> 6. Add jetty-https-2.xml to ${JETTY_BASE}/start.d/https.ini

I'm not sure what you mean by bullet 6... how do you add the XML to
the *.ini file?
You meant *.mod?

Rather than modifying existing Jetty files, I would just create a new
module with a different name.
I would copy `jetty-ssl.xml` and `jetty-https.xml` into another file
called, say, `acme-extra-ssl.xml`.
Then create a module called `acme-extra-ssl.mod`, referencing the new XML.
And then start Jetty with the new module.
Writing a new module is simple, follow:
https://www.eclipse.org/jetty/documentation/jetty-11/operations-guide/index.html#og-modules-custom

Suggestions about improving the documentation, if not clear, are welcome.

This allows you to not mess with the Jetty default modules, which
would be surprising 6 months from now ("why is there a copy of
jetty-https.xml in $JETTY_BASE?!? that should not be needed!").

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top