2 connectors with 2 different context paths?
Asked by Dylan Perks:

We have a Confluence server running just fine, however, we need another connector with a different context path, but I have no idea how to do this?

**++Current connector++**

Path: /confluence

Port: 8090

++**Additional connector requirements**++

Path: /

Port: \<any\>

Any help would be appreciated.


Answers:
author: Dylan Perks
body: I contacted Atlassian support and they reckon I can get what I want with mod_proxy and mod_rewrite


author: Edwin Kyalangalilwa
body: Hi Dylan,

This is done in server.xml

```
<install-dir>/conf/server.xml
```

There you can see an example of the different context paths for Confluence and Synchrony

```
<Context path="" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true"> 
      <Manager pathname=""/> 
      <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/> </Context>

 <Context path="${confluence.context.path}/synchrony-proxy" docBase="../synchrony-proxy" debug="0" reloadable="false" useHttpOnly="true"> 
      <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/> 
</Context>
```

comments: author: Dylan Perks
body: I tried this, as well as tried creating an additional host.

```
<Context path="/confluence" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true"> <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties --> <Manager pathname="" /> <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" /> </Context>
 <Context path="" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true"> <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties --> <Manager pathname="" /> <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" /> </Context>
 <Context path="${confluence.context.path}/synchrony-proxy" docBase="../synchrony-proxy" debug="0" reloadable="false" useHttpOnly="true"> <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" /> </Context>
```

This causes Tomcat to spit out 404 errors, regardless of what URL.

Duplicating the host, but with a different path, caused Tomcat to hang and become unstable.


author: Edwin Kyalangalilwa
body: What exactly are you trying to accomplish?


author: Dylan Perks
body: We need to access confluence from two paths:

**<https://hub.ultz.co.uk/confluence>** and **<https://docs.ultz.co.uk/>**

The latter is mainly for Scroll Viewport


author: Dylan Perks
body: Right now, we have the server.xml setup for <https://hub.ultz.co.uk/confluence>


author: Edwin Kyalangalilwa
body: This can be done by adding two xml files under

```
<install>/conf/Standalone/localhost
```

confluence.xml

```
<?xml version='1.0' encoding='utf-8'?>

<Context path="/confluence" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true">

    <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" />

</Context>
```

ROOT.xml

```
<?xml version='1.0' encoding='utf-8'?>

<Context path="/" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true">

    <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" />

</Context>
```

I wouldn't recommend this because of issues that might occur.

So to understand correctly, users will access the default Confluence in /confluence and a Scroll Viewport version on / ?


author: Dylan Perks
body: > So to understand correctly, users will access the default Confluence in /confluence and a Scroll Viewport version on / ?
>
> Yep! Obviously different hostnames.


author: Nic Brough -Adaptavist-
body: Even with Scroll viewport, you are going to have some problems with this - Confluence only has one base url, which is what goes out on emails and what the system will take the users back to, no matter where they started browsing.