Link JIRA with Confluence
Asked by thomas.newton@pwc.com:

Hello,

I have JIRA and confluence both hosted in different VM. I can access jira with baseURL but confluence I cant access via baseURL but using localhost:8090 I can access internally. But outside VM I can access both applications.

I can ping JIRA baseURL in confluence and confluence baseURL in JIRA (so both can see each other) but I cannot open JIRA in confluence box and confluence in JIRA.

++**Steps to link JIRA with Confluence:**++

When linking applications (in Confluence I clicked -\> General configuration -\> Application link -\> and added <https://mycompany.com> after clicking creating I get an error as shown:

![error.PNG](/t5/image/serverpage/image-id/32976iF7E429E4899C16FD/image-size/large?v=v2&px=999 "error.PNG")

If I click continue it asks for additional details:

![error-2.PNG](/t5/image/serverpage/image-id/32977i989515E0C70E9F81/image-dimensions/291x394?v=v2 "error-2.PNG")

If I click continue I get a link created with a error and if I click edit I get this error:

![error-3.PNG](/t5/image/serverpage/image-id/32978i7E32C62E0F17351F/image-size/large?v=v2&px=999 "error-3.PNG")

Not sure why JIRA is not reachable because I can ping the host fine. This is what my server.xml file looks like:

```
<Server port="8000" shutdown="SHUTDOWN" debug="0">
 <Service name="Tomcat-Standalone">
 <Connector port="8090" connectionTimeout="20000" redirectPort="8443"
 maxThreads="48" minSpareThreads="10"
 enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
 protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" proxyName="mycompany.com" proxyPort="443"/>
 
 <!-- scheme="https" proxyName="mycompany.com" proxyPort="443" secure="true"-->
 

 <Engine name="Standalone" defaultHost="localhost" debug="0">

 <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">
 
 <Context docBase="../confluence" path="" reloadable="false" useHttpOnly="true" debug="0">
 <!-- 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>
 </Host>

 </Engine>

 <!--
 To run Confluence via HTTPS:
 * Uncomment the Connector below
 * Execute:
 %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
 $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
 with a password value of "changeit" for both the certificate and the keystore itself.
 * Restart and visit https://localhost:8443/

 For more info, see https://confluence.atlassian.com/display/DOC/Running+Confluence+Over+SSL+or+HTTPS
 -->
 

<Connector port="8443" maxHttpHeaderSize="8192"
 maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
 enableLookups="false" disableUploadTimeout="true"
 acceptCount="100" scheme="https" secure="true"
 clientAuth="false" sslProtocol="TLS" SSLEnabled="true"
 URIEncoding="UTF-8" keystoreFile="E:\Program Files\Atlassian\Confluence\jre\confluence_newcert" keystoreType="PFX" keystorePass="PASSWD"/>
 </Service>
</Server>

```

++NOTE:++ if I add security="true" in my connector I cannot log into confluence localhost:8090 in VM (but outside I can) - it redirects me to login page even after logging in.

Confluence do have SSL certificate and uses Tomcat.

When looking into host file in windows where confluence is configured I dont see any DNS entry.

Can someone tell me why I cannot link both app?

Regards,

Dipesh


Answers:
author: Daniel Eads
body: Hi Dipesh,

Sorry you're having some trouble getting applinks set up! From the looks of things, I'd actually recommend using a reverse proxy instead of trying to serve HTTPS directly from Tomcat. Since you're on Windows, the common reverse proxies we see are IIS (should work easily with the PFX certificate you already have), Apache, and nginx now even has a mainline branch build for Windows.

* [Instructions for IIS](https://confluence.atlassian.com/kb/proxying-atlassian-server-applications-with-microsoft-internet-information-services-iis-833931378.html)
* [Instructions for Apache](https://confluence.atlassian.com/kb/proxying-atlassian-server-applications-with-apache-http-server-mod_proxy_http-806032611.html)
* [Instructions for nginx](https://confluence.atlassian.com/doc/running-confluence-behind-nginx-with-ssl-858772080.html)

The instructions should help you reconfigure the connector in your **server.xml** file in addition to configuring your reverse proxy itself. Don't forget to double-check the base URLs in your applications to make sure they are http**s** and have the right addresses. Restart your applications after making changes in server.xml and the proxy.

I think that will mostly get you where you need to be - we do see a lot of issues with trust in the internal keychain and terminating SSL at a reverse proxy is the best way to clear those up.

Cheers,  
Daniel

comments: author: thomas.newton@pwc.com
body: Hi Daniel,

I followed the first link: and this is what my server.xml file looks like now:

```
<Server port="8000" shutdown="SHUTDOWN" debug="0">    <Service name="Tomcat-Standalone">    <Connector port="8090" connectionTimeout="20000" redirectPort="8443"                maxThreads="48" minSpareThreads="10"                enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"                protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="http" proxyName="mycompany.com" proxyPort="80"/>            <Engine name="Standalone" defaultHost="localhost" debug="0">            <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">                   <Context docBase="${catalina.home}/confluence" path="/confluence" reloadable="false" useHttpOnly="true" debug="0">                    <!-- 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>            </Host>        </Engine>        <!--            To run Confluence via HTTPS:             * Uncomment the Connector below             * Execute:                 %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)                 $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)               with a password value of "changeit" for both the certificate and the keystore itself.             * Restart and visit https://localhost:8443/             For more info, see https://confluence.atlassian.com/display/DOC/Running+Confluence+Over+SSL+or+HTTPS        --> <Connector port="8443" maxHttpHeaderSize="8192"                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"                   enableLookups="false" disableUploadTimeout="true"                   acceptCount="100" scheme="https" secure="true"                   clientAuth="false" sslProtocol="TLS" SSLEnabled="true"                   URIEncoding="UTF-8" keystoreFile="E:\Program Files\Atlassian\Confluence\jre\certificate" keystoreType="PFX" keystorePass="PASSWORD"/>    </Service></Server>
```

After restarting confluence server, I cannot load localhost:8090 page or baseURL?

I get error Web Page cannot be found HTTP 404 error

Could you tell me what I need to change in my server.xml file?

Regards,

Dipesh


author: Daniel Eads
body: Hi Dipesh,

I think you'll want to comment out that HTTPS connector that's still at the bottom of your server.xml, and make sure to restart Confluence after saving the file. From there, based on the connector you've configured you should be accessing Confluence via port 80 (at "mycompany.com") which should be proxying through IIS.


author: thomas.newton@pwc.com
body: Hi Daniel,

This is my new server.xml file

```
<Server port="8000" shutdown="SHUTDOWN" debug="0">    <Service name="Tomcat-Standalone">    <Connector port="8090" connectionTimeout="20000" redirectPort="8443"                maxThreads="48" minSpareThreads="10"                enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"                protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="http" proxyName="mycompany.com" proxyPort="80"/>                     <Engine name="Standalone" defaultHost="localhost" debug="0">            <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">                   <Context path="/confluence" docBase="${catalina.home}/confluence" reloadable="false" useHttpOnly="true" debug="0">                    <!-- 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>            </Host>   <Valve className="org.apache.catalina.valves.AccessLogValve" pattern="%a %{confluence.request.id}r %{confluence.request.username}r %t &quot;%m %U%q %H&quot; %s %b %D &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot; &quot;%{confluence.request.assession.id}r&quot;"/>        </Engine>         <!--            To run Confluence via HTTPS:             * Uncomment the Connector below             * Execute:                 %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)                 $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)               with a password value of "changeit" for both the certificate and the keystore itself.             * Restart and visit https://localhost:8443/             For more info, see https://confluence.atlassian.com/display/DOC/Running+Confluence+Over+SSL+or+HTTPS        -->    </Service></Server>
```

I cannot reach localhost:80 or <http://mycompany.com> or <http://mycompany.com:80> I've looked at hostfile under C:\\windowszsystem32\\drivers\\etc\\hosts and I dont see the <http://mycompany.com> entry there.

Regards,

Dipesh


Tags: application-link

confluence-server

jira

jira-server

server