Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket Server listen localhost only

a_teijeiro September 20, 2016

Hi,

How can i change bitbucket server to listen localhost only: Instead of:

netstat :::7990 :::5701 :::7999,  this: 127.0.0.1:7990 127.0.0.1:5701 127.0.0.1:7999.  

Thanks!

3 answers

0 votes
Bill G November 3, 2020

All threads I found on this topic appear to be outdated.  This was the best match for both searching google and the Atlassian community for "Bitbucket listen localhost only".  Being new here, I wasn't sure if this should be opened as a new thread in lieu of necroing this one. 

Having a local firewall to block access to unecessary interfaces is not an option.

There does not appear to be a server.xml file located on the most current release of Bitbucket, and the bitbucket.properties file contains the following at the top of the file:

#> Migrated to database at jdbc:postgresql://localhost:5432/GIT?targetServerType=master

I assume this has been moved to a Bitbucket setting from within the interface, but it is eluding me.

The following is from the page http://127.0.0.1:7990/admin/server-settings:

Bitbucket/Administration/Server Settings/Base URL is set to http://127.0.0.1:7990

Here are my listening ports for Bitbucket:

# netstat -anp | grep -iw 799.
tcp 0 0 0.0.0.0:7999 0.0.0.0:* LISTEN 2999/java
tcp 0 0 0.0.0.0:7990 0.0.0.0:* LISTEN 2999/java
tcp 0 0 127.0.0.1:7992 0.0.0.0:* LISTEN 2989/java
tcp 0 0 127.0.0.1:7993 0.0.0.0:* LISTEN 2989/java
tcp 0 0 127.0.0.1:7992 127.0.0.1:51936 ESTABLISHED 2989/java
tcp 0 0 127.0.0.1:51936 127.0.0.1:7992 ESTABLISHED 2999/java

I'd like to the top two listening on 127.0.0.1 instead of 0.0.0.0, just like the rest of them.

0 votes
maik_herrmann January 30, 2017

Hi,

since Bitbucket is running on tomcat you only need to tell tomcat that it should accept local connections only. How do you do that?

Add address="127.0.0.1" to your connector in the server.xml located in the conf folder of your Bitbucket installation. See line 6 in the example below.

<Connector port="7990" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   useBodyEncodingForURI="true"
                   redirectPort="8443"
                   compression="on"
				   address="127.0.0.1"
                   compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript" />

Please let me know if this was helpful.

0 votes
ryan2clw December 28, 2016

I need to know this too

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events