Bitbucket : How bind to the port 80

Chang Park October 7, 2015

I would like to ask how to bind the port 80 so that user can only type the hostname in URL.  I assume Bitbucket is running as root because installation process says that it has to run as root in order to create Bitbucket as service.  I have 2 answers from Bitbucket support engineer, but none of them worked.  The answers are,

  1. With using tomcat, simply modify <Connector port="7990" ...> to 80 in $STAHS_HOME/shared/server.xml file.
  2. With apache httpd, follow the instruction in https://confluence.atlassian.com/display/KB/Integrating+Apache+HTTP+Server+reverse+proxy+with+Bitbucket+Server.  

#1 is only one change and it doesn't work.  Port 80 Anything has to be done besides changing 

For #2, there are several steps to follow, but I didn't understand a couple of steps.

  1. There is steps to enable the proxy modules.  How can I enable proxy modules?  I checked httpd.conf file and all those modules were not already commented, which I assume those modules are already enabled.  Anything else needs to be done to enable proxy modules.

  2. Add "ProxyPass" and "ProxyPassReverse" in Apache configuration file.  I added 2 lines in

    <VirtualHost *:80>

        ProxyPass / http://localhost:7990
        ProxyPassReverse / http://localhost:7990
    </VirtualHost *80>

    The reason that I used "http://localhost:7990" is because Apache and Bitbucket server live on the same machine.  

After following the steps, I restarted apache and went to Bitbucket URL.  But I didn't get connected with the error like "proxy locahost:7990 .."  What needed to be done?

Thanks for your help in advance.

1 answer

0 votes
Steven F Behnke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 7, 2015

Neither of these are readily supported by Atlassian unfortunately because they are considered external systems. 

Indeed, the difficulty in using port 80 is that most operating systems don't allow most applications to run on port 80 unless they are root (and you shouldn't always run applications as root as a rule of thumb). This is an example of the OS being an external system impacting your desired function.

Further, the difficulty in setting up a proxy is that then you are using another webserver to run on port 80. This means you must first configure the webserver and then configure your own application to proxy the data. This again is an external system of which you can choose anything and Atlassian has no control over.

 

So the use-case is:

Problem – "I want to be able to access Bitbucket without specifying a port."

Solution – Serve the content on port 80 for HTTP requests or 443 for HTTPS requests.

 

Possible implementations:

  • Discover a way to allow Bitbucket to run below port 1024 on your OS
  • Proxy content to a separate webserver like httpd or nginx and let that application serve the content instead
  • Use IPTABLES or an equivalent routing function to route traffic from 7990 to 80

 

Helpful documentation:

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events