Tomcat installation per tarball (Ubuntu 18.04): Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
 
(46 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
{{note|Noch in Bearbeitung}}
== Allgemein ==


=== CATALINA_HOME_vs._CATALINA_BASE ===
* CATALINA_HOME = Verzeichnis, wo die Binärdateien liegen
* CATALINA_BASE = Verzeichnis, wo die Instanz-spezifischen Dateien (z.B. Konfigurationsdateien) liegen (bei einer Instanz können beide Variablen gleich sein)
==== Links ====
[https://tomcat.apache.org/tomcat-10.0-doc/introduction.html#CATALINA_HOME_and_CATALINA_BASE https://tomcat.apache.org/tomcat-10.0-doc/introduction.html#CATALINA_HOME_and_CATALINA_BASE]


== Voraussetzungen ==
== Voraussetzungen ==
Zeile 48: Zeile 56:


=== Umgebungsvariablen setzen ===
=== Umgebungsvariablen setzen ===
* CATALINA_HOME = Verzeichnis, wo die Binärdateien liegen
* CATALINA_BASE = Verzeichnis, wo die Instanz-spezifischen Dateien (z.B. Konfigurationsdateien) liegen (bei einer Instanz können beide Variablen gleich sein)


Dazu eine Datei ''/etc/tomcat10.conf'' erstellen:
Dazu eine Datei ''/etc/tomcat10.conf'' erstellen:
Zeile 118: Zeile 123:


=== Admin-GUI's für alle Addressen erlauben ===
=== Admin-GUI's für alle Addressen erlauben ===
{{note|Hinweis: Bei mehreren Tomcat-Instanzen kann man den Remote-Zugriff zentral in ''CATALINA_BASE'' erlauben (siehe 2. Absatz).}}
==== In ''${CATALINA_HOME}'' bei einzelner Tomcat-Instanz ====


''${CATALINA_HOME}/webapps/manager/META-INF/context.xml:''
''${CATALINA_HOME}/webapps/manager/META-INF/context.xml:''
Zeile 162: Zeile 163:
wie vorher ebenfalls <code>Valve</code> auskommentieren.
wie vorher ebenfalls <code>Valve</code> auskommentieren.


==== In ''${CATALINA_HOME}'' bei mehreren Tomcat-Instanzen ====
=== ''scanManifest'' deaktivieren ===
 
''${CATALINA_BASE}/conf/Catalina/localhost/manager.xml:''


Die Datei
In der Datei


<pre>
<pre>
sudo vi /opt/tomcat/tomcat10_0_0/tomcat10/conf/Catalina/localhost/manager.xml
sudo vi /opt/tomcat/tomcat10_0_0/tomcat10/conf/context.xml
</pre>
</pre>


erstellen und mit folgendem Inhalt befüllen:
folgenden Eintrag


<pre>
<pre>
<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/manager">
<?xml version="1.0" encoding="UTF-8"?>
  <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
<Context>
</Context>
    ...
</pre>


    <JarScanner scanManifest="false"/>


''${CATALINA_BASE}/conf/Catalina/localhost/host-manager.xml:''
    ...
 
</Context>
Die Datei
 
<pre>
sudo vi /opt/tomcat/tomcat10_0_0/tomcat10/conf/Catalina/localhost/host-manager.xml
</pre>
</pre>


erstellen und mit folgendem Inhalt befüllen:
hinzufügen, um das Scannen von Manifest-Dateien zu deaktivieren.
 
<pre>
<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/host-manager">
  <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
</pre>


=== Als Service mit ''systemctl'' ===
=== Als Service mit ''systemctl'' ===
Zeile 213: Zeile 202:
Group=tomcat
Group=tomcat


Environment=TOMCAT_CFG=/opt/tomcat/tomcat10_0_0/tomcat10/conf/tomcat10.conf
Environment=CATALINA_PID=/tmp/tomcat10.pid
Environment=CATALINA_PID=/tmp/tomcat10.pid
Environment=TOMCAT_JAVA_HOME=/usr/bin/java
Environment=TOMCAT_JAVA_HOME=/usr/bin/java
Zeile 218: Zeile 208:
Environment=CATALINA_BASE=/opt/tomcat/tomcat10_0_0/tomcat10
Environment=CATALINA_BASE=/opt/tomcat/tomcat10_0_0/tomcat10
Environment=CATALINA_OPTS=
Environment=CATALINA_OPTS=
Environment="JAVA_OPTS=-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -XX:+CMSClassUnloadingEnabled -XX:+UseG1GC -XX:MaxPermSize=128m -Xms512m -Xmx512m"
Environment="JAVA_OPTS=-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -XX:+CMSClassUnloadingEnabled -Xms512m -Xmx512m"


ExecStart=/opt/tomcat/tomcat10_0_0/tomcat10/bin/startup.sh
ExecStart=/opt/tomcat/tomcat10_0_0/tomcat10/bin/startup.sh
Zeile 235: Zeile 225:
== Mehrere Tomcat-Instanzen parallel ==
== Mehrere Tomcat-Instanzen parallel ==


{{note|Noch in Bearbeitung}}
Für jede weitere Instanz ein weiteres Verzeichnis (''CATALINA_BASE'') anlegen. Das Unterverzeichnise ''webapps'' wird komplett und ''conf'' nur teilweise kopiert. Anstelle des Unterverzeichnisses ''bin'' wird ein symbolischer Link zu ''CATALINA_HOME/bin'' gesetzt.


Für jede weitere Instanz ein weiteres Verzeichnis (''CATALINA_BASE'') anlegen. Die Unterverzeichnise ''conf'' und ''webapps'' werden kopiert. Anstelle des Unterverzeichnisses ''bin'' wird ein symbolischer Link zu ''CATALINA_HOME/bin'' gesetzt.
<pre>
<pre>
cd /opt/tomcat/tomcat10_0_0/
cd /opt/tomcat/tomcat10_0_0/
Zeile 282: Zeile 271:
</pre>
</pre>


=== ''$CATALINA_HOME/tomcat10_1/conf/'' ===
=== ''$CATALINA_BASE/tomcat10_1/conf/'' ===


<pre>
<pre>
sudo su
sudo su
cd /opt/tomcat/tomcat10_0_0/tomcat10_1/conf
cd /opt/tomcat/tomcat10_0_0/tomcat10_1/conf
for i in `ls ../../tomcat10/conf/`;  do  sudo -u tomcat ln -s  ../tomcat10/conf/$i $i;  done
for i in `ls ../../tomcat10/conf/`;  do  sudo -u tomcat ln -s  ../../tomcat10/conf/$i $i;  done
rm server.xml
rm server.xml
cp -u tomcat ../../tomcat10/conf/server.xml .
cp ../../tomcat10/conf/server.xml .
rm Catalina
sudo -u tomcat mkdir -p Catalina/localhost/
cd Catalina/localhost/
sudo -u tomcat ln -s ../../../../tomcat10/conf/Catalina/localhost/host-manager.xml host-manager.xml
sudo -u tomcat ln -s ../../../../tomcat10/conf/Catalina/localhost/manager.xml manager.xml
exit
exit
</pre>
</pre>


=== ''$CATALINA_HOME/startup.sh'' ===
=== ''$CATALINA_BASE/startup.sh'' ===
 
{{note|Pfad des startup.sh-Skripts ist ''tomcat10_<instance>/'' anstelle von ''tomcat10_<instance>/bin/'' !}}


Danach in der Datei
Danach in der Datei
Zeile 327: Zeile 323:
</pre>
</pre>


=== ''$CATALINA_HOME/shutdown.sh'' ===
=== ''$CATALINA_BASE/shutdown.sh'' ===
 
{{note|Pfad des shutdown.sh-Skripts ist ''tomcat10_<instance>/'' anstelle von ''tomcat10_<instance>/bin/'' !}}


Dasselbe wie in der Datei <code>$CATALINA_HOME/startup.sh</code> auch in der Datei
Dasselbe wie in der Datei <code>$CATALINA_HOME/startup.sh</code> auch in der Datei
Zeile 337: Zeile 335:
durchführen.
durchführen.


=== ''$CATALINA_HOME/conf/server.xml'' ===
=== ''$CATALINA_BASE/conf/server.xml'' ===


Alle Instanzen müssen unterschiedliche Ports verwenden. Die verwendeten Ports werden in der Datei ''$CATALINA_HOME/conf/server.xml'' geändert:
Alle Instanzen müssen unterschiedliche Ports verwenden. Die verwendeten Ports werden in der Datei ''$CATALINA_BASE/conf/server.xml'' geändert:


<pre>
<pre>
vi /opt/tomcat/tomcat10_0_0/tomcat10_1/conf/server.xml
sudo vi /opt/tomcat/tomcat10_0_0/tomcat10_1/conf/server.xml
</pre>
</pre>


Zeile 366: Zeile 364:
Ein Möglichkeit ist, die führende '''8''' bei allen Ports jeweils erhöhen oder erniedrigen. Aus ''8005'' wird dann z.B. ''9005''.
Ein Möglichkeit ist, die führende '''8''' bei allen Ports jeweils erhöhen oder erniedrigen. Aus ''8005'' wird dann z.B. ''9005''.


=== $CATALINA_HOME/conf/tomcat10_<instance> ===
=== $CATALINA_BASE/conf/tomcat10_<instance> ===


In den Konfigurations-Dateien ''tomcat10'' durch ''tomcat10_<instance>'' (ausgenommen ''CATALINA_HOME'') ersetzen
In den Konfigurations-Dateien ''tomcat10'' durch ''tomcat10_<instance>'' (ausgenommen ''CATALINA_HOME'' und ''JASPER_HOME'') ersetzen


<pre>
<pre>
Zeile 376: Zeile 374:
# Where your tomcat installation lives
# Where your tomcat installation lives
CATALINA_BASE="/opt/tomcat/tomcat10_0_0/tomcat10_<instance>"
CATALINA_BASE="/opt/tomcat/tomcat10_0_0/tomcat10_<instance>"
CATALINA_HOME="/opt/tomcat/tomcat10_0_0/tomcat10_<instance>"
CATALINA_HOME="/opt/tomcat/tomcat10_0_0/tomcat10
JASPER_HOME="/opt/tomcat/tomcat10_0_0/tomcat10_<instance>"
JASPER_HOME="/opt/tomcat/tomcat10_0_0/tomcat10"
CATALINA_TMPDIR="/opt/tomcat/tomcat10_0_10/tomcat10_<instance>/temp"
CATALINA_TMPDIR="/opt/tomcat/tomcat10_0_10/tomcat10_<instance>/temp"


Zeile 386: Zeile 384:
TOMCAT_USER="tomcat"
TOMCAT_USER="tomcat"
</pre>
</pre>
=== /etc/systemd/system/tomcat10_<instance>.service ===
{{note|Pfad der startup.sh/shutdown.sh-Skripte ist ''tomcat10_<instance>/'' anstelle von ''tomcat10_<instance>/bin/'' !}}
<pre>
cd /etc/systemd/system/
sudo cp tomcat10.service tomcat10_<instance>.service
</pre>
{{note|Hinweis: ''CATALINA_HOME'' auf /opt/tomcat/tomcat10_0_0/tomcat10 belassen}}
Danach in der Datei
<pre>
sudo vi /etc/systemd/system/tomcat10_<instance>.service
</pre>
alle Pfade entsprechend anpassen.
== Log-Rotate ==
=== Links ===
[https://www.jfrog.com/confluence/display/JFROG/Configuring+Log+Rotation+for+Tomcat https://www.jfrog.com/confluence/display/JFROG/Configuring+Log+Rotation+for+Tomcat]


== Load Balancer ==
== Load Balancer ==
Zeile 394: Zeile 417:


[[Tomcat und Eclipse (Linux)|Tomcat und Eclipse]]
[[Tomcat und Eclipse (Linux)|Tomcat und Eclipse]]
== Probleme ==
=== WARNUNG [main] org.apache.tomcat.util.scan.StandardJarScanner.processURLs Failed to scan [file: ... ] from classloader hierarchy ===
''scanManifest'' ist standardmäßig auf ''true'' gesetzt und sollte deaktiviert werden: [[Tomcat installation per tarball (Ubuntu 18.04)#scanManifest_deaktivieren|scanManifest deaktivieren]]




Zurück zu [[Tomcat installation per tarball (unterschiedliche Versionen)#Ubuntu Versionen|Tomcat (tarball)]]
Zurück zu [[Tomcat installation per tarball (unterschiedliche Versionen)#Ubuntu Versionen|Tomcat (tarball)]]

Aktuelle Version vom 5. Juli 2022, 08:49 Uhr

Allgemein

CATALINA_HOME_vs._CATALINA_BASE

  • CATALINA_HOME = Verzeichnis, wo die Binärdateien liegen
  • CATALINA_BASE = Verzeichnis, wo die Instanz-spezifischen Dateien (z.B. Konfigurationsdateien) liegen (bei einer Instanz können beide Variablen gleich sein)

Links

https://tomcat.apache.org/tomcat-10.0-doc/introduction.html#CATALINA_HOME_and_CATALINA_BASE

Voraussetzungen

Java siehe Java (Ubuntu)

Benutzer anlegen

sudo addgroup --system --no-create-home --disabled-login --group tomcat
sudo adduser --system --no-create-home --disabled-login --ingroup tomcat tomcat

Alternativ mit fixer UID:

sudo addgroup --system --no-create-home --disabled-login --uid 128 --group tomcat
sudo adduser --system --no-create-home --disabled-login --uid 128 --ingroup tomcat tomcat 

Download

Verfügbare Versionen siehe http://www.eu.apache.org/dist/tomcat/

wget https://downloads.apache.org/tomcat/tomcat-10/v10.0.0/bin/apache-tomcat-10.0.0.tar.gz
tar -xzf apache-tomcat-10.0.0.tar.gz

Installationsverzeichnis anlegen:

sudo mkdir -p /opt/tomcat/tomcat10_0_0/

Entpacktes Tomcat-Verzeichnis verschieben und Besitzer setzen:

sudo mv apache-tomcat-10.0.0 /opt/tomcat/tomcat10_0_0/tomcat10
sudo chown -R tomcat:tomcat /opt/tomcat/tomcat10_0_0/

Installation

Einen symbolischen Link auf das Verzeichnis mit der Version für Tomcat 10 anlegen (falls mehrere Versionen installiert sind):

cd /opt/tomcat/
sudo ln -s /opt/tomcat/tomcat10_0_0 tomcat10

Umgebungsvariablen setzen

Dazu eine Datei /etc/tomcat10.conf erstellen:

sudo vi /etc/tomcat10.conf

Diese Datei mit folgenden Inhalt befüllen:

# Where your java installation lives
JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-armhf"

# Where your tomcat installation lives
CATALINA_BASE="/opt/tomcat/tomcat10_0_0/tomcat10"
CATALINA_HOME="/opt/tomcat/tomcat10_0_0/tomcat10"
JASPER_HOME="/opt/tomcat/tomcat10_0_0/tomcat10"
CATALINA_TMPDIR="/opt/tomcat/tomcat10_0_10/tomcat10/temp"

# Set the TOMCAT_PID location
CATALINA_PID="/tmp/tomcat10.pid"

# What user should run tomcat
TOMCAT_USER="tomcat"

In der Datei /opt/tomcat/tomcat10_0_0/tomcat10/bin/catalina.sh die Variablenkonfiguration einfügen:

sudo vi /opt/tomcat/tomcat10_0_0/tomcat10/bin/catalina.sh
...
# Ensure that any user defined CLASSPATH variables are not used on startup,
# but allow them to be specified in setenv.sh, in rare case when it is needed.
CLASSPATH=

# Get the tomcat config (use this for environment specific settings)
if [ -z "${TOMCAT_CFG}" ]; then
        TOMCAT_CFG="/etc/tomcat10.conf"
fi

if [ -r "$TOMCAT_CFG" ]; then
        . $TOMCAT_CFG
fi

if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
  . "$CATALINA_BASE/bin/setenv.sh"
...

Konfiguration

Tomcat Benutzer anlegen

Dazu in der Datei $CATALINA_HOME/conf/tomcat-users.xml folgende Zeilen zwischen <tomcat-users> und </tomcat-users> einfügen:

sudo vi /opt/tomcat/tomcat10_0_0/tomcat10/conf/tomcat-users.xml
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="admin-gui,manager-gui"/>

Admin-GUI's für alle Addressen erlauben

${CATALINA_HOME}/webapps/manager/META-INF/context.xml:

Dazu die Datei

sudo vi /opt/tomcat/tomcat10_0_0/tomcat10/webapps/manager/META-INF/context.xml

bearbeiten und folgende Zeile auskommentieren:

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

...

<Context antiResourceLocking="false" privileged="true" >

...

<!--
  <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
-->      

...

</Context>


${CATALINA_HOME}/webapps/host-manager/META-INF/context.xml:

Weiters in der Datei

sudo vi /opt/tomcat/tomcat10_0_0/tomcat10/webapps/host-manager/META-INF/context.xml

wie vorher ebenfalls Valve auskommentieren.

scanManifest deaktivieren

In der Datei

sudo vi /opt/tomcat/tomcat10_0_0/tomcat10/conf/context.xml

folgenden Eintrag

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

    <JarScanner scanManifest="false"/>

    ...
</Context>

hinzufügen, um das Scannen von Manifest-Dateien zu deaktivieren.

Als Service mit systemctl

sudo vi /etc/systemd/system/tomcat10.service
[Unit]
Description=Tomcat10
After=network.target

[Service]
Type=forking
User=tomcat
Group=tomcat

Environment=TOMCAT_CFG=/opt/tomcat/tomcat10_0_0/tomcat10/conf/tomcat10.conf 
Environment=CATALINA_PID=/tmp/tomcat10.pid
Environment=TOMCAT_JAVA_HOME=/usr/bin/java
Environment=CATALINA_HOME=/opt/tomcat/tomcat10_0_0/tomcat10
Environment=CATALINA_BASE=/opt/tomcat/tomcat10_0_0/tomcat10
Environment=CATALINA_OPTS=
Environment="JAVA_OPTS=-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -XX:+CMSClassUnloadingEnabled -Xms512m -Xmx512m"

ExecStart=/opt/tomcat/tomcat10_0_0/tomcat10/bin/startup.sh
ExecStop=/opt/tomcat/tomcat10_0_0/tomcat10/bin/shutdown.sh

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start tomcat10.service
sudo systemctl enable tomcat10.service

Mehrere Tomcat-Instanzen parallel

Für jede weitere Instanz ein weiteres Verzeichnis (CATALINA_BASE) anlegen. Das Unterverzeichnise webapps wird komplett und conf nur teilweise kopiert. Anstelle des Unterverzeichnisses bin wird ein symbolischer Link zu CATALINA_HOME/bin gesetzt.

cd /opt/tomcat/tomcat10_0_0/
sudo chmod a+x tomcat10/conf/
sudo -u tomcat mkdir -p tomcat10_1/conf/
sudo cp /etc/tomcat10.conf tomcat10_1/conf/tomcat10_1.conf
sudo -u tomcat cp -r tomcat10/webapps/ tomcat10_1/webapps/
sudo -u tomcat cp tomcat10/bin/startup.sh tomcat10_1/startup.sh
sudo -u tomcat cp tomcat10/bin/shutdown.sh tomcat10_1/shutdown.sh
sudo -u tomcat mkdir tomcat10_1/logs/
sudo -u tomcat mkdir tomcat10_1/temp/
sudo -u tomcat mkdir tomcat10_1/work/
cd tomcat10_1
sudo -u tomcat ln -s ../tomcat10/lib lib
sudo -u tomcat ln -s ../tomcat10/bin bin
cd conf
sudo rm tomcat-users.*
sudo -u tomcat ln -s ../../tomcat10/conf/tomcat-users.xml tomcat-users.xml
sudo -u tomcat ln -s ../../tomcat10/conf/tomcat-users.xsd tomcat-users.xsd
sudo chown -R tomcat:tomcat /opt/tomcat/tomcat10_0_0/tomcat10_1/
sudo chmod -R 755 /opt/tomcat/tomcat10_0_0/tomcat10_1/

Dieser Vorgang wird für jede weitere Instanz wiederholt:

cd /opt/tomcat/tomcat10_0_0/
sudo mkdir -p tomcat10_<instance>/conf/
sudo cp /etc/tomcat10.conf tomcat10_<instance>/conf/tomcat10_<instance>.conf
sudo cp -r tomcat10/webapps/ tomcat10_<instance>/webapps/
sudo cp tomcat10/bin/startup.sh tomcat10_<instance>/startup.sh
sudo cp tomcat10/bin/shutdown.sh tomcat10_<instance>/shutdown.sh
sudo mkdir tomcat10_<instance>/logs/
sudo mkdir tomcat10_<instance>/temp/
sudo mkdir tomcat10_<instance>/work/
cd tomcat10_<instance>
sudo ln -s ../tomcat10/lib lib
sudo ln -s ../tomcat10/bin bin
cd conf
sudo rm tomcat-users.*
sudo ln -s ../../tomcat10/conf/tomcat-users.xml tomcat-users.xml
sudo ln -s ../../tomcat10/conf/tomcat-users.xsd tomcat-users.xsd
sudo chown -R tomcat:tomcat /opt/tomcat/tomcat10_0_0/tomcat10_<instance>/
sudo chmod -R 755 /opt/tomcat/tomcat10_0_0/tomcat10_<instance>/

$CATALINA_BASE/tomcat10_1/conf/

sudo su
cd /opt/tomcat/tomcat10_0_0/tomcat10_1/conf
for i in `ls ../../tomcat10/conf/`;  do  sudo -u tomcat ln -s  ../../tomcat10/conf/$i $i;  done
rm server.xml
cp ../../tomcat10/conf/server.xml .
rm Catalina
sudo -u tomcat mkdir -p Catalina/localhost/
cd Catalina/localhost/
sudo -u tomcat ln -s ../../../../tomcat10/conf/Catalina/localhost/host-manager.xml host-manager.xml
sudo -u tomcat ln -s ../../../../tomcat10/conf/Catalina/localhost/manager.xml manager.xml
exit

$CATALINA_BASE/startup.sh

Pfad des startup.sh-Skripts ist tomcat10_<instance>/ anstelle von tomcat10_<instance>/bin/ !

Danach in der Datei

sudo vi /opt/tomcat/tomcat10_0_0/tomcat10_1/startup.sh

nach den Zeilen

# resolve links - $0 may be a softlink
PRG="$0"

while [ -h "$PRG" ] ; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '/.*' > /dev/null; then
    PRG="$link"
  else
    PRG=`dirname "$PRG"`/"$link"
  fi
done

folgende Zeilen hinzufügen bzw. anpassen:

# use this for environment specific settings
export TOMCAT_CFG=`dirname "$PRG"`/"conf/tomcat10_1.conf"

PRGDIR=`dirname "$PRG"`/"../tomcat10/bin"

$CATALINA_BASE/shutdown.sh

Pfad des shutdown.sh-Skripts ist tomcat10_<instance>/ anstelle von tomcat10_<instance>/bin/ !

Dasselbe wie in der Datei $CATALINA_HOME/startup.sh auch in der Datei

sudo vi /opt/tomcat/tomcat10_0_0/tomcat10_1/shutdown.sh

durchführen.

$CATALINA_BASE/conf/server.xml

Alle Instanzen müssen unterschiedliche Ports verwenden. Die verwendeten Ports werden in der Datei $CATALINA_BASE/conf/server.xml geändert:

sudo vi /opt/tomcat/tomcat10_0_0/tomcat10_1/conf/server.xml

Die Standard-Ports sind in der folgenden Tabelle aufgelistet:

Port Beschreibung
8005 Shutdown Port
8080 Connector Port
8443 Redirect Port
8009 AJP Connector Port

Ein Möglichkeit ist, die führende 8 bei allen Ports jeweils erhöhen oder erniedrigen. Aus 8005 wird dann z.B. 9005.

$CATALINA_BASE/conf/tomcat10_<instance>

In den Konfigurations-Dateien tomcat10 durch tomcat10_<instance> (ausgenommen CATALINA_HOME und JASPER_HOME) ersetzen

# Where your java installation lives
JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-armhf"

# Where your tomcat installation lives
CATALINA_BASE="/opt/tomcat/tomcat10_0_0/tomcat10_<instance>"
CATALINA_HOME="/opt/tomcat/tomcat10_0_0/tomcat10
JASPER_HOME="/opt/tomcat/tomcat10_0_0/tomcat10"
CATALINA_TMPDIR="/opt/tomcat/tomcat10_0_10/tomcat10_<instance>/temp"

# Set the TOMCAT_PID location
CATALINA_PID="/tmp/tomcat10_<instance>.pid"

# What user should run tomcat
TOMCAT_USER="tomcat"

/etc/systemd/system/tomcat10_<instance>.service

Pfad der startup.sh/shutdown.sh-Skripte ist tomcat10_<instance>/ anstelle von tomcat10_<instance>/bin/ !

cd /etc/systemd/system/
sudo cp tomcat10.service tomcat10_<instance>.service

Hinweis: CATALINA_HOME auf /opt/tomcat/tomcat10_0_0/tomcat10 belassen

Danach in der Datei

sudo vi /etc/systemd/system/tomcat10_<instance>.service

alle Pfade entsprechend anpassen.

Log-Rotate

Links

https://www.jfrog.com/confluence/display/JFROG/Configuring+Log+Rotation+for+Tomcat

Load Balancer

Load Balancer mit mod_jk (Linux)

Eclipse

Tomcat und Eclipse

Probleme

WARNUNG [main] org.apache.tomcat.util.scan.StandardJarScanner.processURLs Failed to scan [file: ... ] from classloader hierarchy

scanManifest ist standardmäßig auf true gesetzt und sollte deaktiviert werden: scanManifest deaktivieren


Zurück zu Tomcat (tarball)