Binding a web project to a specific host in Apache Karaf

With Karaf 3 and Pax Web 3, it is possible to bind a web application to a specific HTTP connector. This is a feasible solution to separate internal and external applications on the same server.

Getting ready

The sample code for this recipe is available at https://github.com/jgoodyear/ApacheKarafCookbook/tree/master/chapter4/chapter4-recipe8. Here, you will find a jetty.xml file at the src/main/etc location. It can be used to add an extra connector. Two extra recipes are available to show how to use this with a standard WAB file or the Whiteboard extender.

How to do it…

First of all, the server needs to be configured to support different HTTP connectors. Therefore, it is necessary to configure ...

Get Apache Karaf Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.