Multiple Atlassian applications under same domain?

Markus Fredén
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 7, 2017

Hello!

Is it possible to have JIRA and Confluence under the same domain but with different context paths using Apache?

http://mydomain.com/jira
http://mydomain.com/confluence

 They are both installed on the same ubuntu server.

Best regards,

Markus

2 answers

1 accepted

0 votes
Answer accepted
Markus Fredén
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 7, 2017

Hi Seb,

Thanks for the quick reply!

I'm not exactly sure which part doesn't work but I actually just got it to work when using a subdomain and was going to post it here.

You're right, it's very similar to my conf. This is what I currently have that is working:

Two active separate site files.

1. confluence.conf;

<VirtualHost *:80>

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName mydomain.com

ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On

<Proxy *>
Require all granted
</Proxy>

ProxyPass / http://localhost:8090/
ProxyPassReverse / http://localhost:8090/

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

2. jira.conf

<VirtualHost *:80>

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName subdomain.mydomain.com

ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On

<Proxy *>
Require all granted
</Proxy>

ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

 

This setup works but I want JIRA to be on mydomain.com/jira

I've tried what's in your example conf, having both in the same config but that makes only one of them accessible (unless using local IP+port in browser).

I've also tried having them in separate site files and only setting context path in JIRA's site file (And also setting it in server.xml + restart).

Do you know what I might be missing?

Thanks in advance!

Best regards,

Markus

Sebastian Brookfield September 11, 2017

Hi Markus,

Appologies for getting back to you late.

I've spun up an Ubuntu server and got it configured how you want it.

Below are the steps I've taken to get this running.

Firstly, I had to install apache2 and enabled everything I needed for mod_proxy.
Once I'd done this, I installed JIRA and Confluence using the default ports 8080, and 8090 without any proxying.
Once I was comfortable that these were working, I tested each one by reverse proxying to the root of my domain without changing the context.
Finally, I updated each instance to use a context of /jira and /confluence.

I ended up with the following configuration:

 /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80>
ServerName example.co.uk
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPreserveHost On
ProxyPass /jira http://example.co.uk:8080/jira
ProxyPassReverse /jira http://example.co.uk:8080/jira
ProxyPass /confluence http://example.co.uk:8090/confluence
ProxyPassReverse /confluence http://example.co.uk:8090/confluence
</VirtualHost>

 /opt/atlassian/jira/conf/server.xml

<Connector port="8080"

maxThreads="150"
minSpareThreads="25"
connectionTimeout="20000"

enableLookups="false"
maxHttpHeaderSize="8192"
protocol="HTTP/1.1"
useBodyEncodingForURI="true"
redirectPort="8443"
acceptCount="100"
disableUploadTimeout="true"
bindOnInit="false"
proxyName="example.co.uk"
proxyPort="80"
scheme="http"
/>

...

<Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

 /opt/atlassian/confluence/conf/server.xml

<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"
proxyName="example.co.uk"
proxyPort="80"
scheme="http"/>

...

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

 The trick I'd missed was that when using a context path, the reverse proxy URL must include this.

Hopefully this helps, 

Seb

Like Saman Sadeghi likes this
Markus Fredén
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 11, 2017

Wow!

Thanks alot Seb!

I really appreciate you taking so much time answereing my questions.

This pretty much sums up what I wanted to achieve.

Now I have a server with JIRA and confluence in my closet that I can access from work to do testing! Woho!

Have a great day!

Best regards,

Markus

1 vote
Sebastian Brookfield September 7, 2017

Hi Markus!

The following article covers running Atlassian under one domain using reverse proxy.

https://confluence.atlassian.com/kb/integrating-apache-http-server-reverse-proxy-with-jira-753894357.html

This should help you achive what you would like.

Kind regards,

Seb

Markus Fredén
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 7, 2017

Hey Seb,

Thanks, but I've gone through that several times already...

But it's the apache conf I'm having issues with so I guess I should post somewhere else.

Thanks anyways.

Best regards,

Markus

Sebastian Brookfield September 7, 2017

Hi Markus,

Which part of the config are you having issues with?
I'd expect you'd have something similar to the below in your Apache config.

Config.png

Kind regards,

Seb

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events