Problems setting up Confluence Server at https://www.mydomain.com/wiki
Asked by Nathan Wailes:

Hi,

I've been using Confluence for about 4 years now, and I have a personal Confluence Cloud instance.

Yesterday I bought a license for a server-hosted instance of Confluence that I want to use for my DigitalOcean-hosted online business (<https://www.rhymecraft.guru/>).

I was able to install it and get it running, but:

1. It's accessible at the DigitalOcean server's IP address ([http://XXX.XX.XXX.XX](http://XXX.XX.XXX.XX:8090)), but not at the domain name that points to that IP address ([http://www.rhymecraft.guru](https://www.rhymecraft.guru)).

2. I want the wiki to be accessed at a subpage at <https://www.rhymecraft.guru/wiki>, without needing to use a port number as part of the URL (so I guess that would mean making it work on port 443 for HTTPS). I *was* able to get it working at <http://XXX.XX.XXX.XX/wiki> (so, not using SSH, using the default HTTP port 80, and being at /wiki, but using the server's direct IP address rather than my domain name).

* [server.xml](https://gist.github.com/NathanWailes/5f47ae8a4cf326c4696771e736d8a7b2)
* [rhymecraft.conf](https://gist.github.com/NathanWailes/eb26ff1119b704c5eb5d3be36967aebf)


Answers:
author: Tobias Anstett _K15t_
body: Hi Nathan,

If you already managed to get it running on the IP using port 80 and your context path it is most likely not a Confluence/Tomcat configuration issue but a proxy or domain name mapping issues.

Have you double checked that after changing server.xml to port 80 you got rid of the ports in rhymecraft.conf as well?

Best, Tobias

comments: author: Nathan Wailes
body: I was able to get it working, I just needed to have the website's Apache config settings right.

* I needed to turn off a Rewrite rule that was changing all HTTP requests to HTTPS
* I needed the proxy to redirect to localhost on port 8090, not 80. Redirecting to localhost on port 80 seemed to be causing a circular redirect.

Below is what the rhymecraft.conf looks like now (minus the virtualhost for port 443 / HTTPS):

```
WSGIDaemonProcess rhymecraft.guru processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup rhymecraft.guru

<VirtualHost *:80>
 ServerName www.rhymecraft.guru
 ServerAlias rhymecraft.guru
 ServerAdmin nathan.wailes@gmail.com

 # The proxy stuff below is for Confluence
 # See https://confluence.atlassian.com/kb/proxying-atlassian-server-applications-with-apache-http-server-mod_proxy_http-806032611.html
 ProxyRequests Off
 <Proxy *>
 Require all granted
 </Proxy>
 ProxyPass /synchrony http://localhost:8091/synchrony
 <Location /synchrony>
 Require all granted
 RewriteEngine on
 RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
 RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
 RewriteRule .* ws://127.0.0.1:8091%{REQUEST_URI} [P]
 </Location>
 ProxyPass /wiki http://localhost:8090/wiki
 ProxyPassReverse /wiki http://localhost:8090/wiki
 <Location /wiki>
 Require all granted
 </Location>

 Alias /blog /var/www/html

 WSGIScriptAlias / /var/www/rhymecraft/server/rhymecraft.wsgi

 DocumentRoot /var/www/rhymecraft/server

 Alias /robots.txt /var/www/rhymecraft/server/robots.txt
 Alias /favicon.ico /var/www/rhymecraft/server/robots.txt

 <Directory /var/www/rhymecraft/server>
 Order allow,deny
 Allow from all
 </Directory>

 Alias /static /var/www/rhymecraft/server/static 

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

# RewriteEngine on
# RewriteCond %{SERVER_NAME} =www.rhymecraft.guru [OR]
# RewriteCond %{SERVER_NAME} =rhymecraft.guru
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
```


Tags: confluence-server

server