How to configure remote access to Confluence
Asked by Adam Saunders:

Hi,

I have just installed Confluence internally on our Windows server. v 5.10.

I initially started using the site on the server so <http://localhost:8090> worked fine. I tried to access it remotely from another machine on our network, but couldn't, so I allowed the port through the firewall and everything seemed all good.

Now I'm navigating the site and setting up new spaces, but I find places where the url seems to default back to "localhost" rather than the ip address that I'm currently using of the server.

Once you create a new space, it tries to navigate the user to the homepage of the space, but the URL changes from \<ip\>:\<port\> to localhost:\<port\>

Have I missed a step or gone about things wrong, or is this a bug. Seems unlikely to be a bug and more likely that I've not accessed the site correctly.

Also, is there a way to change the default port that the server is listening on. Having to specify a port (8090) isn't going to work for some of our less technical people. Or do I need to do funky port forwarding to get around this.

Thanks


Answers:
author: Nic Brough -Adaptavist-
body: I suspect you have set the "base url" to localhost:8090 (well, not you directly, but the installer will default to this, as it's aimed at getting you up and running quickly with a local install that you can change later)

Check the setting in Admin -\> General Config - if I'm right there, then you'll want to change it to the URL you are going to use to access Confluence.

Changing that URL and dropping the port is mostly a network thing. You'll probably want a DNS entry so that <http://myconfluenceserver> lands on the aaa.bbb.ccc.ddd address you have for your server.

Generally, you don't actually get rid of the port. When you see addresses that don't have a port, what is actually happening is that the browser is assuming a port (80 for http and 443 for https) and the server is listening on that port. Confluence is run on 8090 by default because most people are usually running a web server on 80 and/or 443 on servers and don't want the clash (only one application can use a port)  

So, there's two basic tricks.

1. If that server is NOT running **anything** else on port 80, you can change the port in the server.xml from 8090 to 80, and it'll take over running all http requests to that server. This can have additional difficulties apart from other web-services - most systems protect 80 as it's an easy attack vector (most linux systems will not allow programs to run on ports below 1024 unless they have special privilelges. I don't know if Windows does similar things)
2. Proxy it on a web-server. Apache, Nginx, Lighttpd, IIS and so-on all have some form of proxy systems where they can pick up a domain or part of a domain request coming in on port 80 and forward the request on to the correct system. It's common to see things like <https://myplace/confluence> and <https://myplace/jira> proxied like that - the webserver knows that for the first url, it should talk to <http://confserver/confluence:8090> and <http://jiraserver/jira:8080> for the second

comments: author: Adam Saunders
body: Thanks Nic. I was able to find the setting to change the "Server Base URL" setting, it now works as expected. I would have been very surprised if this ended up being a bug rather than a configuration item.

I already knew about the browser assuming port 80/443 bit, but the URL rewrite thing is great. I have tested that out and it will come in very handy with this AND some other upcoming projects. So thanks for that extra gem.


Tags: confluence-administration