0

I have created a server in AWS with Ubuntu installation. I have 3 domains with me. Now I want to host all three domains in that same server in the same Karaf instance. Just like we can do it in Apache Tomcat using Host tag in some configuration XML file.

I have already installed Karaf on the server, installed webconsole to test the configuration in the beginning.

Update Due to the confusion factor, I am adding an image to explain what I want to achieve.

enter image description here

Jayesh
  • 402
  • 1
  • 4
  • 22

1 Answers1

0

Karaf uses Jetty (assuming you've installed pax-http feature). Jetty is configured in your <KARAF_HOME>/etc/jetty.xml where you can add virtual hosts. Jetty's documentation regarding virtual hosts is here.

Milen Dyankov
  • 2,972
  • 14
  • 25
  • I can do that but the problem that I will face is, I deploy my website using bundles and not war files. From the link that you have mentioned, in example section, it explicitly targets a war file for mapping. What I want is (if possible) to have a bundle that will internally, inside karaf, allocates requests to specific bundles as per the requested domain. eg, let bundle MAIN is where all request will land, now it will allocate all request for www.A.com to bundle A and all from www.B.com to bundle B This is what I want to achieve. I hope you get my requirements well. – Jayesh Apr 13 '17 at 04:08
  • It would even more better if Karaf can do this on its own. – Jayesh Apr 13 '17 at 04:09
  • I suggest you to update the question then. What you asked was "like we can do it in Apache Tomcat using Host tag in some configuration XML file" thus my answer! I'm not a Jetty expert myself but I guess you can do the same thing from code. How exactly would depend a lot on how you create/register the http contexts in your bundle(s). – Milen Dyankov Apr 13 '17 at 10:29