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

how to set stash's port to 80?

Bin Hua May 5, 2015

I install stash on a server, and I want to set  its port to 80, so how can i do?

4 answers

5 votes
Larry Shatzer
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.
May 5, 2015

You should look at the reverse proxy documentation for Stash.

Balázs Szakmáry
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.
May 5, 2015

Why would you want to start with this instead of simply changing the Tomcat port in server.xml?

Larry Shatzer
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.
May 6, 2015

I'd rather not run something, such as Stash, as a higher privileged user such as root, or an admin user.

1 vote
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.
May 5, 2015

Well, Stash works just like the other Atlassian applications, so you can do what @Larry Shatzer suggested and reverse-proxy it to another webcontainer listening on port 80 OR you could change the server.xml for Stash's Tomcat to listen on port 80.

This isn't as much a Stash question as it is a web-container/application question, good question though. 

0 votes
Daniel Wester
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.
May 8, 2015

You can't change the port to be port 80 if you're running linux. In order for a process to be run on a port <100 it needs to be run as root. I would not run Stash as root because of the git hooks.

To "change" the port - add nginx or apache in front of it and have them reverese proxy to port 80. You can do it with iptables as well but that might get messy real quick.

0 votes
IshanL
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.
May 5, 2015

You can change server.xml. Also make sure to start the application under superuser otherwise sometimes you will not be able to bind to dedicated ports like 80 without root privilege.

 

e.g

&lt;Connector port="80" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   useBodyEncodingForURI="true"
                   redirectPort="8443"
                   compression="on"
                   compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript" /&gt;
Bin Hua May 6, 2015

I can'f find the server.xml file, I installed stash by using xx.bin

IshanL
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.
May 6, 2015

The default path is /opt/atlassian/stash

Bin Hua May 6, 2015

There's no such file called `server.xml` in path `/opt/atlassian/stash/3.8.1`

IshanL
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.
May 6, 2015

There should be a directory called "conf". server.xml file is inside that directory.

Bin Hua May 6, 2015

yes, there's a folder called `conf`, but there's no server.xml also, files in this folder Catalina catalina.properties logging.properties tomcat-users.xml web.xml catalina.policy context.xml scripts.cfg tomcat-users.xsd

IshanL
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.
May 6, 2015

Sorry It is changed now. Pls refer below doc. The new path is /opt/atlassian/stash/3.8.1/shared https://confluence.atlassian.com/display/STASH/Changing+the+port+that+Stash+listens+on

Bin Hua May 6, 2015

I find the server.xml file, and do it following this link https://confluence.atlassian.com/display/STASH/Changing+the+port+that+Stash+listens+on, but it still doesn't work.

Paz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 6, 2015

So, you're able to change the port to 80? Could mark this as the answer? And just a heads up, the server.xml file did move recently so that you wouldn't have to carry over customizations when you upgraded. Old location: <Stash installation directory>/conf/server.xml New location: <Stash home directory>/shared/server.xml

Bin Hua May 7, 2015

I find the server.xml, but I give up to change the port, it seems not work, I set it following this link. https://confluence.atlassian.com/display/STASH/Changing+the+port+that+Stash+listens+on

IshanL
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.
May 7, 2015

Then its something wrong with your set up and its up to you to trouble shoot. Above link explains how to do it correctly.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events