# Forwarding 2 Knime Servers with the same context path

**URL:** <https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370>\
**Category:** KNIME Server\
**Created:** [September 19, 2024, 11:45am UTC](https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370 "2024-09-19T11:45:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![b\_kochs](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/2acd7d/32.png) [@b\_kochs](https://forum.knime.com/u/b_kochs)\
**Post date:** [September 19, 2024, 11:45am UTC](https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370/1 "2024-09-19T11:45:42Z")

</div>

Hello  
we currently use httpd (apache) webserver on 2 different servers.  
Forwarding a knime-server url (2) was not a problem, but in future there will be only on server with httpd (apache) installed. The context path of both knime-servers are the same. What is the recommended way to configure httpd (apache) ?

Greetings B.Kochs

---

<div class="post-metadata">

**Author:** ![AlexanderFillbrunn](https://forum-cdn.knime.com/user_avatar/forum.knime.com/alexanderfillbrunn/32/357_2.png) [@AlexanderFillbrunn](https://forum.knime.com/u/AlexanderFillbrunn)\
**Post date:** [September 24, 2024, 11:19am UTC](https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370/2 "2024-09-24T11:19:20Z")

</div>

Hello,  
Let me summarize what I think I understood:  
You are running two KNIME Servers in parallel, currently each being routed through a separate Apache httpd server. Now you would like to get rid of one httpd and route traffic to both KNIME Servers through one httpd instance. Is that correct?  
If yes, you will need to determine how the httpd should distinguish requests between the two servers. One way is host-based routing (see [here](https://httpd.apache.org/docs/2.4/vhosts/name-based.html)). This would mean you configure your DNS to have [server1.myhost.com](http://server1.myhost.com) and [server2.myhost.com](http://server2.myhost.com) to both point to the httpd instance. In the instance, you configure two VirtualHosts, one with the server name [server1.myhost.com](http://server1.myhost.com) and one with the server name [server2.myhost.com](http://server2.myhost.com). In each you set up the forwarding using [mod\_proxy\_balancer](https://httpd.apache.org/docs/current/mod/mod_proxy_balancer.html) with the corresponding KNIME Server as BalancerMember.  
Kind regards,  
Alexander

---

<div class="post-metadata">

**Author:** ![b\_kochs](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/2acd7d/32.png) [@b\_kochs](https://forum.knime.com/u/b_kochs)\
**Post date:** [September 25, 2024, 10:16am UTC](https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370/3 "2024-09-25T10:16:15Z")

</div>

Hello  
each of the 2 Knime-Servers has it’s own Apache Webserver.  
One if for testing and the other is the production server.  
There is no Loadbalancing required, because both knime-servers serve  
a different purpose.  
But the context path knime\_cloud would by the same.  
[https://testing.domain.de/knime\_cloud/](https://testing.domain.de/knime_cloud/)  
[https://production.domain.de/knime\_cloud/](https://production.domain.de/knime_cloud/)  
Currently one Apache Webserver is hosted on [testing.domain.de](http://testing.domain.de) the other on [production.domain.de](http://production.domain.de).  
Now there is a new Apache-server [new.domain.de](http://new.domain.de) which should forward both knime-servers.  
Because of the same context path : knime\_cloud I could either

1. Change the context path of one of the knime-servers , so forwarding by the new server [new.domain.de](http://new.domain.de) would by easy. There’s allready a thread in this forum how to change the context path of a knime server.
2. Configure a url-rewrite in the new Apache-server [new.domain.de](http://new.domain.de).

In 1) I fear the knime-server does not start up , when configuring like mentioned here:

> [@How to change the value of context root](https://forum.knime.com/t/how-to-change-the-value-of-context-root/10547):
>
> Hello, I have installed KNIME server 4.3.2(using auto installation) and I would like to chnage the context root for web portal as shown below http:// \<server address \>: / / Is it possible to change the configuration to set new context root in Knime\_Server\_4\_3\_2\workflow\_repository\config\knime-server.config? or Where should I change the settings?

In 2) I think this would be rather complicated, maybe the rewrite-url does not work properly, but at least the Knime-Server config would not have to be changed.  
Which solution would you recommend?  
Greetings B.Kochs

---

<div class="post-metadata">

**Author:** ![AlexanderFillbrunn](https://forum-cdn.knime.com/user_avatar/forum.knime.com/alexanderfillbrunn/32/357_2.png) [@AlexanderFillbrunn](https://forum.knime.com/u/AlexanderFillbrunn)\
**Post date:** [September 25, 2024, 11:18am UTC](https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370/4 "2024-09-25T11:18:39Z")

</div>

Hi,  
Ah, so you were talking about an Apache Tomcat server hosting KNIME Server [testing.domain.de](http://testing.domain.de) and another one KNIME Server [production.domain.de](http://production.domain.de), and now you want one Tomcat hosting both server instances separately? Or do you want to keep the two Tomcats and have an _additional_ server routing the traffic to them? What do you mean when you refer to “forwarding”? I have never tried it, but hosting two KNIME Server instances in one Apache Tomcat probably does not work.  
Kind regards,  
Alexander

---

<div class="post-metadata">

**Author:** ![b\_kochs](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/2acd7d/32.png) [@b\_kochs](https://forum.knime.com/u/b_kochs)\
**Post date:** [September 25, 2024, 12:02pm UTC](https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370/5 "2024-09-25T12:02:22Z")

</div>

Hello  
perhabs I am using the wrong term: forwarding  
more likely to be titled:redirecting

which is done in the following file  
(this configuration work, but of course not with both knime-servers)

/etc/httpd/conf.d/knime.conf \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
ProxyPreserveHost On

ProxyPass “/knime\_cloud” “[http://10.20.30.40:8080/knime\_cloud](http://10.20.30.40:8080/knime_cloud)”  
ProxyPassReverse “/knime\_cloud” “[http://10.20.30.40:8080/knime\_cloud](http://10.20.30.40:8080/knime_cloud)”

* * *

‘but hosting two KNIME Server instances in one Apache Tomcat probably does not work.’ → No this does not work, by just renaming the context\_path in this config-file:knime.conf  
Greetings B.Kochs

---

<div class="post-metadata">

**Author:** ![AlexanderFillbrunn](https://forum-cdn.knime.com/user_avatar/forum.knime.com/alexanderfillbrunn/32/357_2.png) [@AlexanderFillbrunn](https://forum.knime.com/u/AlexanderFillbrunn)\
**Post date:** [September 26, 2024, 11:11am UTC](https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370/6 "2024-09-26T11:11:01Z")

</div>

Hi,  
Okay, I understand. Did you check [this link](https://httpd.apache.org/docs/2.4/vhosts/name-based.html) from by first reply? You would set up httpd to listen to requests and if they have the host header [testing.domain.de](http://testing.domain.de) they go to one server and if they have [prod.domain.de](http://prod.domain.de) they go to another one.  
Kind regards,  
Alexander

---

<div class="post-metadata">

**Author:** ![b\_kochs](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/2acd7d/32.png) [@b\_kochs](https://forum.knime.com/u/b_kochs)\
**Post date:** [September 26, 2024, 1:01pm UTC](https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370/7 "2024-09-26T13:01:41Z")

</div>

Hello  
’ Unterstützung namensbasierter virtueller Hosts’ leads to using 2 different domain names. We intend to have one hostname. So the context url should be differend , and I wrote a script which ‘renamed’ the context url .  
After that I renamed the KNIME\_EXECUTOR\_PROFILES in 3 Files, altered the settings of the apache httpd on our old solaris server and was able to connect and execute tasks in webportal und knime analytic platform.  
The context urls of testing and prod now are different and the new Apache httpd can distinguish between them.  
The renamed context url of the prod server via Apache httpd on solaris works now, for now the case is close. Thanks  
Greetings B.Kochs

---

<div class="post-metadata">

**Author:** ![AlexanderFillbrunn](https://forum-cdn.knime.com/user_avatar/forum.knime.com/alexanderfillbrunn/32/357_2.png) [@AlexanderFillbrunn](https://forum.knime.com/u/AlexanderFillbrunn)\
**Post date:** [September 26, 2024, 1:59pm UTC](https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370/8 "2024-09-26T13:59:03Z")

</div>

Hi,  
Thank you for the update! When you open the WebPortal of the server, does it correctly resolve the CSS and Javascript files in this setup? I’d have thought that this would be a problem.  
Kind regards,  
Alexander

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [December 25, 2024, 1:59pm UTC](https://forum.knime.com/t/forwarding-2-knime-servers-with-the-same-context-path/83370/9 "2024-12-25T13:59:23Z")

</div>

Closed on December 25, 2024, 1:59pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
