Change localhost for confluence
Asked by Robert Imhoff:

I am installing confluence on a CentOS 7 vm in VM Fusion. I cannot test "localhost:8090" since there is no browser on the VM. How do I edit server.xml to allow for connection from a different computer for initial setup?


Answers:
author: Robert Imhoff
body: Adding "-Djava.net.preferIPv4Stack=true" to the end of the first Java prefix line in %install%/bin/setenv.sh fixed this issue in combo with "iptables -F" which flushed the local fw rules. I will need to add rule for after reboot. Thank you for the help!


author: Arley Silveira
body: HAving pretty much the same issue...ne1 got this working?


author: Chag
body: you mentioned you are using VM fusion correct? are you using a regular IP with the HOST's IP? or using NAT? if using NAT make sure you are forwanding ports.


author: Nic Brough -Adaptavist-
body: You don't. Server.xml is only telling it what port to listen on. How other computers get to that port is up to your network.

localhost is always "this computer". Your VM has another IP address it exposes to your network, so replacing localhost with that IP address means "go to that VM". You can then use DNS to give it a name. All you need to do is tack :8090 to the end of the ip or name to get to Confluence. ( I suspect you're already accessing it with something like "ssh Robert@ourserver.ournetwork" - try browsing to [](http://ourserver.ournetwork:8090)<http://ourserver.ournetwork:8090>)

comments: author: Robert Imhoff
body: When I do [](http://ip:8090)<http://ip:8090>I get "no data recieved" from my chrome browser. When I do netstat -an \| grep 8090, it only displays 127.0.0.1:8090 in the list, not \*:8090 or ip:8090


author: Nic Brough -Adaptavist-
body: That doesn't sound like a server error. Could you try a different browser? (Or even just chrome in private browsing mode)


author: Nic Brough -Adaptavist-
body: Ah, ok, it's using IPv6. I half-answered that on your other question (sorry - I didn't realise it was the same person!).

I say half because all I've got there is a workaround - you'll be able to use CentOS 7, forced to use IPv4 (actually, just the Tomcat running Confluence will use it). But Confluence ought to work on IPv6 and I don't know why it messes up like this. Oddly, I got a different error, but I suspect it was compounded with SSL, so I was getting better error messages!


author: Robert Imhoff
body: tried on Chrome private, firefox and safari. No dice.

I can ssh to box, that is fine.

I do look carefully at netstat -an \| grep LIST and see that it is:

tcp6 0 0 :::8090 :::\* LISTEN

Not sure how to make CentOS 7 force it to regular ipv4. Should I just dump CentOS 7 and go back to 6?


author: Robert Imhoff
body: CentOS 7 defaults to IPv6 not IPv4 on install of Confluence. Unable to get to work with IPv4. If you know how to force IPv4, that will be a first step before moving forward with installation on CentOS 7.


author: Nic Brough -Adaptavist-
body: The flag I mentioned on your other question will solve it.


author: Robert Imhoff
body: I am unsure how to force CentOS 7 to make this use ipv4 only (tried doing the system.disable_ipv6 thing, which did not work).

I will just use CentOS 6 for this project.


author: Robert Imhoff
body: Adding "-Djava.net.preferIPv4Stack=true" to the end of the first Java prefix line in %install%/conf/setenv.sh fixed this issue for not listening on ipv4. However, the page still does not load from another host.


author: Robert Imhoff
body: I can connect on localhost now, but still cannot get the server to respond from another host.

$ netstat -na \| grep LIST

tcp 0 0 127.0.0.1:25 0.0.0.0:\* LISTEN

tcp 0 0 0.0.0.0:8090 0.0.0.0:\* LISTEN

tcp 0 0 127.0.0.1:8000 0.0.0.0:\* LISTEN

tcp 0 0 0.0.0.0:22 0.0.0.0:\* LISTEN

tcp6 0 0 ::1:25 :::\* LISTEN

tcp6 0 0 :::22 :::\* LISTEN

$ nc 127.0.0.1 8090

GET / HTTP/1.0

HTTP/1.1 302 Found

Server: Apache-Coyote/1.1

X-Confluence-Request-Time: 1406655181924

Location: <http://localhost:8090/bootstrap/selectsetupstep.action>

Content-Type: text/html;charset=UTF-8

Content-Length: 0

Date: Tue, 29 Jul 2014 17:33:01 GMT

Connection: close


author: Nic Brough -Adaptavist-
body: The fact you're getting the setup location means there's somethign useful coming back from the server. That implies your network is blocking the next response, or your browser isn't getting it.


author: Chag
body: you mentioned you are using VM fusion correct? are you using a regular IP with the HOST's IP? or using NAT? if using NAT make sure you are forwanding ports


Tags: confluence-administration