how to change the port to 80 correctly?

I change the port following this link https://confluence.atlassian.com/display/STASH/Changing+the+port+that+Stash+listens+on, but both the two link  http://stash_visit_url.com and http://stash_visit_url.com:7990 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="org.apache.catalina.security.SecurityListener" />

    -->

    <!--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

    -->

    <GlobalNamingResources>

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

             UserDatabaseRealm to authenticate users

        -->

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

                  type="org.apache.catalina.UserDatabase"

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

                  factory="org.apache.catalina.users.MemoryUserDatabaseFactory"

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

    </GlobalNamingResources>




    <!-- 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"

                   connectionTimeout="20000"

                   useBodyEncodingForURI="true"

                   redirectPort="8443"

                   compression="on"

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

2 answers

0 vote
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 https://confluence.atlassian.com/display/STASH/Proxying+and+securing+Stash for more information on how to do that, without running Stash as root.

0 vote

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. 

 

Regards, 

Renato Rudnicki

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

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

31,142 views 26 12
Join discussion

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