|
| 1 | +<?xml version='1.0' encoding='utf-8'?> |
| 2 | +<!-- |
| 3 | + Dynamically generated by Chef on <%= node["fqdn"] %> |
| 4 | + Local modifications will be overwritten by Chef. |
| 5 | +--> |
| 6 | +<!-- |
| 7 | + Licensed to the Apache Software Foundation (ASF) under one or more |
| 8 | + contributor license agreements. See the NOTICE file distributed with |
| 9 | + this work for additional information regarding copyright ownership. |
| 10 | + The ASF licenses this file to You under the Apache License, Version 2.0 |
| 11 | + (the "License"); you may not use this file except in compliance with |
| 12 | + the License. You may obtain a copy of the License at |
| 13 | +
|
| 14 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | +
|
| 16 | + Unless required by applicable law or agreed to in writing, software |
| 17 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 18 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 | + See the License for the specific language governing permissions and |
| 20 | + limitations under the License. |
| 21 | +--> |
| 22 | +<!-- Note: A "Server" is not itself a "Container", so you may not |
| 23 | + define subcomponents such as "Valves" at this level. |
| 24 | + Documentation at /docs/config/server.html |
| 25 | + --> |
| 26 | +<Server port="8006" shutdown="SHUTDOWN"> |
| 27 | + <!-- Security listener. Documentation at /docs/config/listeners.html |
| 28 | + <Listener className="org.apache.catalina.security.SecurityListener" /> |
| 29 | + --> |
| 30 | + <!--APR library loader. Documentation at /docs/apr.html --> |
| 31 | + <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> |
| 32 | + <!-- Prevent memory leaks due to use of particular java/javax APIs--> |
| 33 | + <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> |
| 34 | + <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> |
| 35 | + <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> |
| 36 | + |
| 37 | + <!-- Global JNDI resources |
| 38 | + Documentation at /docs/jndi-resources-howto.html |
| 39 | + --> |
| 40 | + <GlobalNamingResources> |
| 41 | + <!-- Editable user database that can also be used by |
| 42 | + UserDatabaseRealm to authenticate users |
| 43 | + --> |
| 44 | + <Resource name="UserDatabase" auth="Container" |
| 45 | + type="org.apache.catalina.UserDatabase" |
| 46 | + description="User database that can be updated and saved" |
| 47 | + factory="org.apache.catalina.users.MemoryUserDatabaseFactory" |
| 48 | + pathname="conf/tomcat-users.xml" /> |
| 49 | + </GlobalNamingResources> |
| 50 | + |
| 51 | + <!-- A "Service" is a collection of one or more "Connectors" that share |
| 52 | + a single "Container" Note: A "Service" is not itself a "Container", |
| 53 | + so you may not define subcomponents such as "Valves" at this level. |
| 54 | + Documentation at /docs/config/service.html |
| 55 | + --> |
| 56 | + <Service name="Catalina"> |
| 57 | + |
| 58 | + <!--The connectors can use a shared executor, you can define one or more named thread pools--> |
| 59 | + <!-- |
| 60 | + <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" |
| 61 | + maxThreads="150" minSpareThreads="4"/> |
| 62 | + --> |
| 63 | + |
| 64 | + |
| 65 | + <!-- A "Connector" represents an endpoint by which requests are received |
| 66 | + and responses are returned. Documentation at : |
| 67 | + Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) |
| 68 | + Java AJP Connector: /docs/config/ajp.html |
| 69 | + APR (HTTP/AJP) Connector: /docs/apr.html |
| 70 | + Define a non-SSL HTTP/1.1 Connector on port 7990 |
| 71 | +
|
| 72 | + If you change this port, you have to update scripts.cfg as well |
| 73 | + to have the same port configuration. |
| 74 | + --> |
| 75 | + <Connector port="<%= node['stash']['tomcat']['port'] %>" protocol="HTTP/1.1" |
| 76 | + connectionTimeout="20000" |
| 77 | + useBodyEncodingForURI="true" |
| 78 | + compression="on" |
| 79 | + compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript" |
| 80 | + <% if node['stash']['apache2'] -%> |
| 81 | + redirectPort="<%= node['stash']['apache2']['ssl']['port'] %>" |
| 82 | + secure="true" |
| 83 | + scheme="https" |
| 84 | + proxyName="<%= node['stash']['apache2']['virtual_host_alias'] %>" |
| 85 | + proxyPort="<%= node['stash']['apache2']['ssl']['port'] %>" |
| 86 | + <% else -%> |
| 87 | + redirectPort="<%= node['stash']['tomcat']['ssl_port'] %>" |
| 88 | + <% end -%> |
| 89 | + /> |
| 90 | + |
| 91 | + <!-- A "Connector" using the shared thread pool--> |
| 92 | + <!-- |
| 93 | + <Connector executor="tomcatThreadPool" |
| 94 | + port="7990" protocol="HTTP/1.1" |
| 95 | + connectionTimeout="20000" |
| 96 | + redirectPort="8443" /> |
| 97 | + --> |
| 98 | + <!-- Define a SSL HTTP/1.1 Connector on port 8443 |
| 99 | + This connector uses the JSSE configuration, when using APR, the |
| 100 | + connector should be using the OpenSSL style configuration |
| 101 | + described in the APR documentation --> |
| 102 | + <Connector port="<%= node['stash']['tomcat']['ssl_port'] %>" |
| 103 | + maxHttpHeaderSize="8192" |
| 104 | + SSLEnabled="true" |
| 105 | + maxThreads="150" |
| 106 | + minSpareThreads="25" |
| 107 | + maxSpareThreads="75" |
| 108 | + enableLookups="false" |
| 109 | + disableUploadTimeout="true" |
| 110 | + useBodyEncodingForURI="true" |
| 111 | + acceptCount="100" |
| 112 | + scheme="https" |
| 113 | + secure="true" |
| 114 | + clientAuth="false" |
| 115 | + sslProtocol="TLS" |
| 116 | + <%- if @tomcat %> |
| 117 | + <%= "keyAlias=\"#{@tomcat['keyAlias']}\"" if @tomcat['keyAlias'] %> |
| 118 | + <%= "keystoreFile=\"#{@tomcat['keystoreFile']}\"" if @tomcat['keystoreFile'] %> |
| 119 | + <%= "keystorePass=\"#{@tomcat['keystorePass']}\"" if @tomcat['keystorePass'] %> |
| 120 | + <%- end %> |
| 121 | + /> |
| 122 | + <!-- |
| 123 | + <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" |
| 124 | + maxThreads="150" scheme="https" secure="true" |
| 125 | + clientAuth="false" sslProtocol="TLS" /> |
| 126 | + --> |
| 127 | + |
| 128 | + |
| 129 | + <!-- An Engine represents the entry point (within Catalina) that processes |
| 130 | + every request. The Engine implementation for Tomcat stand alone |
| 131 | + analyzes the HTTP headers included with the request, and passes them |
| 132 | + on to the appropriate Host (virtual host). |
| 133 | + Documentation at /docs/config/engine.html --> |
| 134 | + |
| 135 | + <!-- You should set jvmRoute to support load-balancing via AJP ie : |
| 136 | + <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> |
| 137 | + --> |
| 138 | + <Engine name="Catalina" defaultHost="localhost"> |
| 139 | + |
| 140 | + <!-- For clustering, please take a look at documentation at: |
| 141 | + /docs/cluster-howto.html (simple how to) |
| 142 | + /docs/config/cluster.html (reference documentation) --> |
| 143 | + <!-- |
| 144 | + <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> |
| 145 | + --> |
| 146 | + |
| 147 | + <!-- Use the LockOutRealm to prevent attempts to guess user passwords |
| 148 | + via a brute-force attack --> |
| 149 | + <Realm className="org.apache.catalina.realm.LockOutRealm"> |
| 150 | + <!-- This Realm uses the UserDatabase configured in the global JNDI |
| 151 | + resources under the key "UserDatabase". Any edits |
| 152 | + that are performed against this UserDatabase are immediately |
| 153 | + available for use by the Realm. --> |
| 154 | + <Realm className="org.apache.catalina.realm.UserDatabaseRealm" |
| 155 | + resourceName="UserDatabase"/> |
| 156 | + </Realm> |
| 157 | + |
| 158 | + |
| 159 | + <Host name="localhost" appBase="webapps" |
| 160 | + unpackWARs="true" autoDeploy="true" |
| 161 | + xmlValidation="false" xmlNamespaceAware="false"> |
| 162 | + |
| 163 | + |
| 164 | + <!-- Before changing the context path for Stash, please read our documentation: |
| 165 | + https://confluence.atlassian.com/x/5oCNEQ |
| 166 | +
|
| 167 | + You will have to update scripts.cfg AND |
| 168 | + rename webapps/ROOT directory. |
| 169 | +
|
| 170 | + --> |
| 171 | + |
| 172 | + <Context docBase="${catalina.home}/atlassian-stash" |
| 173 | + path="" |
| 174 | + reloadable="false" |
| 175 | + useHttpOnly="true"/> |
| 176 | + |
| 177 | + <!-- SingleSignOn valve, share authentication between web applications |
| 178 | + Documentation at: /docs/config/valve.html --> |
| 179 | + <!-- |
| 180 | + <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> |
| 181 | + --> |
| 182 | + |
| 183 | + <!-- Access log processes all example. |
| 184 | + Documentation at: /docs/config/valve.html |
| 185 | + Note: The pattern used is equivalent to using pattern="common" --> |
| 186 | + <!-- |
| 187 | + <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" |
| 188 | + prefix="localhost_access_log." suffix=".txt" |
| 189 | + pattern="%h %l %u %t "%r" %s %b" /> |
| 190 | + --> |
| 191 | + </Host> |
| 192 | + </Engine> |
| 193 | + </Service> |
| 194 | +</Server> |
0 commit comments