Get Confluence working on a subdomain
Asked by Philip Deubner:

Software properties:

* OS: Ubuntu 16.04 (with PLESK installed)
* Webserver: Apache 2.4.18
* Confluence 6.3.1

Dear all,

I simply try to get Confluence working on a subdomain like sub.domain.tld.

To do so, I read the documentation and the community forums.

After doing so, I felt ready to start.

What I did was to

1. Create an A-name entry for the sub-domain in the DNS
2. Add the subdomain to /etc/hosts
3. Install Confluence
4. Create a config file under /etc/apache2/confluence with the entries, where XXX.XXX.XXX.XXX is my IP-adress:

    <VirtualHost XXX.XXX.XXX.XXX:80>    ServerName sub.domain.tld 	ProxyRequests Off		# Auth changes in 2.4	<Proxy XXX.XXX.XXX.XXX>		Require all granted	</Proxy>	ProxyPass /synchrony http://<internal_domain>:8091/synchrony	<Location /synchrony>		Require all granted		RewriteEngine on		RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]		RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]		RewriteRule .* ws://domain.tld:8091%{REQUEST_URI} [P]	</Location>	ProxyPass / h ttp://domain.tld:8090/	ProxyPassReverse / h ttp://domain.tld:8090/	<Location />		Require all granted	</Location> </VirtualHost><code></code>

* Enable the new site
* Change server.xml according to [this](https://confluence.atlassian.com/kb/proxying-atlassian-server-applications-with-apache-http-server-mod_proxy_http-806032611.html) documentation (add proxy name, proxy port and scheme)
* Restart Confluence
* Restart Apache2

Unfortunately, this does not help me.

When entering sub.domain.tld in a browser, I am redirected to the PLESK "standard" webpage. Only entering the port 8090 will allow me to enter the confluence webpage.

Any ideas from your side?

Thank you in advance,

best regards,

Philip


Answers:
author: Philip Deubner
body: [@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454):

Thank you for your support. This was - unfortunately - only a problem in this post.

The "real" lines are
> ProxyPass / <http://domain.tld:8090/>  
>
> ProxyPassReverse / <http://domain.tld:8090/>

Any other idea on what might be wrong?

Thank you in advance.

comments: author: Nic Brough -Adaptavist-
body: Hmm. It looks good to me, so I don't think it's your config.

Two other thoughts -

1) Can you try "sudo netstat - plant" to check that it really is apache listening on port 80?

2) In your apache config, how is Plesk configured?


author: Philip Deubner
body: [@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454)

Your other thoughts were right.

Due to the Plesk integration, the vhost configuration nedded to start with

\<VirtualHost XXX.XXX.XXX.XXX:7080 \>  
ServerName "sub.domain.tld:80"

\[...\]

After applying these changes, it worked.

Thank you for yur support.


author: Nic Brough -Adaptavist-
body: Ah, so Apache was serving up Plesk first on port 80 and then ignoring Confluence because it was listed lower?


author: Philip Deubner
body: You're right.

Solved it finally thanks to your ideas.


author: Nicolas Rehner
body: [@Philip Deubner](/t5/user/viewprofilepage/user-id/1135680) Is \<VirtualHost XXX.XXX.XXX.XXX:7080\> a Standard-Port when using Plesk? Or do I have to find out the individual one for my setup?


author: Philip Deubner
body: [@Nicolas Rehner](/t5/user/viewprofilepage/user-id/1181695): 7080 seems to be a Plesk standard port.

So from my assumption, this should also work at your place.


author: Nic Brough -Adaptavist-
body: Your proxypass and proxypassreverse lines are wrong.

The first one for synchrony is ok, but the other two are html url links and have too many entries. They should be as simple as the synchrony one, and only one url.


Tags: apache

proxy