<?xml version="1.0" encoding="UTF-8"?>

<!--
  Copyright (c) 2022, 2025 Contributors to the Eclipse Foundation

  This program and the accompanying materials are made available under the
  terms of the Eclipse Public License v. 2.0, which is available at
  http://www.eclipse.org/legal/epl-2.0.

  This Source Code may also be made available under the following Secondary
  Licenses when the conditions for such availability set forth in the
  Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
  version 2 with the GNU Classpath Exception, which is available at
  https://www.gnu.org/software/classpath/license.html.

-->

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

    <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
    <Listener className="org.apache.catalina.core.AprLifecycleListener" />
    <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
    <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

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

    <Service name="Catalina">
        <Connector port="8443"
            protocol="org.apache.coyote.http11.Http11NioProtocol"
            maxThreads="150" SSLEnabled="true">
            <SSLHostConfig>
                <Certificate
                    certificateKeystoreFile="conf/localhost-rsa.jks"
                    type="RSA" />
            </SSLHostConfig>
        </Connector>

        <Engine name="Catalina" defaultHost="localhost">
            <Realm className="org.apache.catalina.realm.LockOutRealm">
                <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                resourceName="UserDatabase"/>
            </Realm>
            <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
                <Valve
                    className="org.apache.catalina.valves.AccessLogValve"
                    directory="logs" prefix="localhost_access_log"
                    suffix=".txt"
                    pattern="%h %l %u %t &quot;%r&quot; %s %b" />
            </Host>
        </Engine>
    </Service>
</Server>
