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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

2,048 views 1 5
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