how to change the port to 80 correctly?

I change the port following this link, but both the two link and can't be visited.

I changed the server.xml like following

<Server port="80" shutdown="SHUTDOWN">

    <!-- Security listener. Documentation at /docs/config/listeners.html

    <Listener className="" />


    <!--APR library loader. Documentation at /docs/apr.html -->

    <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />

    <!-- Prevent memory leaks due to use of particular java/javax APIs-->

    <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />

    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

    <!--Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /-->

    <!-- Global JNDI resources

         Documentation at /docs/jndi-resources-howto.html



        <!-- Editable user database that can also be used by

             UserDatabaseRealm to authenticate users


        <Resource name="UserDatabase" auth="Container"


                  description="User database that can be updated and saved"


                  pathname="conf/tomcat-users.xml" />


    <!-- A "Service" is a collection of one or more "Connectors" that share

         a single "Container" Note:  A "Service" is not itself a "Container",

         so you may not define subcomponents such as "Valves" at this level.

         Documentation at /docs/config/service.html


    <Service name="Catalina">

        <!--The connectors can use a shared executor, you can define one or more named thread pools-->


        <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"

            maxThreads="150" minSpareThreads="4"/>


        <!-- A "Connector" represents an endpoint by which requests are received

             and responses are returned. Documentation at :

             Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)

             Java AJP  Connector: /docs/config/ajp.html

             APR (HTTP/AJP) Connector: /docs/apr.html

             Define a non-SSL HTTP/1.1 Connector on port 7990

             If you change this port, you have to update scripts.cfg as well

             to have the same port configuration.


        <Connector port="80" protocol="HTTP/1.1"





                   compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript" />

2 answers

0 votes
Steve King Atlassian Team May 06, 2015

Two things might be at play here, and I'd highly suggest checking the logs for specific errors, but:

Firstly on the first line, your config appears slightly off.

<Server port="80" ...>

Should instead, be left as is, being:

<Server port="8006" ...>

The documentation says "Free port", but unless 8006 is being used by another service, it can stay as is. It isn't used by the end-users.

Secondly, for the Connector port, which is in the <Connector...> part of the config file, this is where the user-facing port is defined. Port 80 on most machines are protected from being used by non-root users, so if you're running as a non-root user you might want to look at doing a port forward instead. I'd try switching Server port back and seeing if the service runs.

See the section "Using a reverse proxy for Stash" on for more information on how to do that, without running Stash as root.

0 votes

Hi Bin, 

Try to change the Connector port to 7990, restart Stash and then try to access this: <stash-url>:7990

Also make sure you don't have any firewall blocking the port number that you are trying to reach.


Hope this helps. 



Renato Rudnicki

thanks, but I want to access with port 80, not 7990

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables ROLLBAR_ACCESS_TOKEN...

216 views 0 12
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you