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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket Server listen localhost only

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

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.

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.

I need to know this too

 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,697 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you