Moving Stash to a different context path
When opened in a viewport, the user will be redirected to: Change Bitbucket's context path.
There are various reasons why you may wish to change the context path for Stash. Two of those are:
- You are running Stash behind a proxy.
- You have another Atlassian application, or Java web application, available at the same hostname and context path as Stash, and are experiencing login problems (see Login and session conflicts with multiple Atlassian applications).
Upgrade Note
Note that the location of server.xml
changed in Stash 3.8. See the Stash upgrade guide.
Changing the context path for Stash:
- Navigate to your Stash home directory.
- Stop Stash. SeeStarting and stopping Stash.
Edit
<Stash home directory>/shared/server.xml
and find the element below:<Context path="" docBase="${catalina.home}/atlassian-stash" reloadable="false" useHttpOnly="true"/>
Update the
path
attribute to reflect the context path that you want Stash to be accessible at, e.g. "/stash":<Context path="/stash" docBase="${catalina.home}/atlassian-stash" reloadable="false" useHttpOnly="true"/>
Then save the file.
- Start Stash. See Starting and stopping Stash.
Stash should now be available at the same host as before under the new context path. For example a server that was at http://localhost:7990 will now be reachable at http://localhost:7990/stash. Once Stash has started, go to the administration area and click Server settings (under 'Settings'). Append the new context path to your base URL:
https://my-stash-hostname:7990/stash
Click Save.
Stash + Apache
Note that if you are running Stash behind Apache:
- You will need to make sure that the host or context path that Stash is exposed on is not also being used by another web application that is listening on a different port.
- If you have updated the Stash context path using the steps outlined above, you will need to update your Apache configuration, as described in Integrating Stash with Apache HTTP Server.
Application Links
If you had Application Links set up before changing the context path in Stash, you will have to recreate those using the new Stash URL. See Linking Stash with JIRA.
SSH
The context path does not affect the URL at which SSH operations occur. After changing the context path so that Stash is accessible at https://my-stash-hostname:7990/stash
, SSH operations occur without the context path at ssh://my-stash-hostname:7999
.