Hi,
I have installed Bitbucket (BB) for the first time by using the .bin package. Seems like a user "atlbitbucket" and /var/atlassian/application-data are being created. Originally, I have created a user "bitbucket" for the initial tar.gz installation but failed and i dont think it is being used anymore.
I am trying to change the default port to 80 and I cannot find server.xml or bitbucket.properties
anywhere.
Please help.
Thank you.
Barry
root@bitbucket:~# ls -la /var/atlassian/application-data/bitbucket/shared/
total 28
drwxr-xr-x 6 atlbitbucket atlbitbucket 4096 Jun 7 13:36 .
drwxr-xr-x 12 atlbitbucket atlbitbucket 4096 Jun 10 11:45 ..
drwxr-xr-x 5 atlbitbucket atlbitbucket 4096 Jun 7 13:30 config
drwxr-xr-x 8 atlbitbucket atlbitbucket 4096 Jun 7 13:36 data
-rw-r--r-- 1 atlbitbucket atlbitbucket 15 Jun 7 13:36 .lock
drwxr-xr-x 3 atlbitbucket atlbitbucket 4096 Jun 7 13:30 plugins
drwxr-xr-x 4 atlbitbucket atlbitbucket 4096 Jun 7 13:30 search
root@bitbucket:~# ls -la /opt/bitbucket/shared
total 24
drwxrwxr-x 6 bitbucket bitbucket 4096 Jun 7 12:37 .
drwxr-xr-x 14 bitbucket bitbucket 4096 Jun 7 13:30 ..
drwxrwxr-x 5 bitbucket bitbucket 4096 Jun 6 14:41 config
drwxrwxr-x 8 bitbucket bitbucket 4096 Jun 7 12:37 data
drwxrwxr-x 3 bitbucket bitbucket 4096 Jun 6 14:40 plugins
drwxrwxr-x 4 bitbucket bitbucket 4096 Jun 6 14:40 search
root@bitbucket:~# ls -la /opt/atlassian/bitbucket/6.3.2/
total 96
drwxr-xr-x 11 atlbitbucket atlbitbucket 4096 Jun 7 13:29 .
drwxr-xr-x 3 root root 4096 Jun 7 13:29 ..
drwxr-xr-x 7 atlbitbucket atlbitbucket 4096 Jun 7 13:29 app
drwxr-xr-x 2 atlbitbucket atlbitbucket 4096 Jun 7 13:29 bin
drwxr-xr-x 8 atlbitbucket atlbitbucket 4096 Jun 7 13:29 elasticsearch
drwxr-xr-x 3 atlbitbucket atlbitbucket 4096 Jun 7 13:30 .install4j
-rw-r--r-- 1 atlbitbucket atlbitbucket 127 Jun 5 01:36 'Launch Bitbucket in browser.url'
drwxr-xr-x 3 atlbitbucket atlbitbucket 4096 Jun 7 13:29 lib
drwxr-xr-x 2 atlbitbucket atlbitbucket 49152 Jun 7 13:29 licenses
drwx------ 2 atlbitbucket atlbitbucket 4096 Jun 7 13:29 logs
-rw-r--r-- 1 atlbitbucket atlbitbucket 2601 Jun 5 01:36 README.txt
drwx------ 2 atlbitbucket atlbitbucket 4096 Jun 7 13:29 temp
drwx------ 2 atlbitbucket atlbitbucket 4096 Jun 7 13:29 work
First off, in order for Bitbucket to bind to port 80, it needs to run as "root" user. At minimum, you would need to start it as root in order for it to bind. This is a bad idea, as it becomes a security vulnerability. If there is a vulnerability with Bitbucket code, it is easy for an attacker to take over the server. This is because Java is running as root, so the attacker has root access by default. A best practice approach would be to set up a reverse proxy ahead of Bitbucket (this can run on the Bitbucket server too) so that it can run as an unprivileged user (atlbitbucket) and bind to port 7990. The proxy server has the smarts to start as root, bind to port 80 and then spawn children that run as an unprivileged user that handle incoming traffic. Check the Atlassian docs on how to do this on Apache, Nginx and HAproxy.
Dave, thank you for your reply.
I read the doc you mentioned. I might have missed something, it seems like a description rather than instruction like "download this", "run this commands". Is there a step by step instruction on setting up the reverse proxy?
In any case, the BB that I am setting up is for internal use. Is there a simple way that I just make BB run on port 80? I have tried adding port 80 to bitbucket.properties file and then reboot. Having the init.d script, I thought it should start up as root using atlbitbucket user (as instructed in BB installation doc). However, it does not seem to work. Any tips how to make it work?
Thanks.
Barry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.