Tomcat (Raspbian): Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
Zeile 15: Zeile 15:
<pre>
<pre>
sudo vi /etc/systemd/system/tomcat.service
sudo vi /etc/systemd/system/tomcat.service
</pre>
<pre>
[Unit]
Description=Tomcat9
After=network.target
[Service]
Type=forking
User=tomcat9
Group=tomcat9
Environment=CATALINA_PID=/opt/tomcat/tomcat9/tomcat9.pid
Environment=TOMCAT_JAVA_HOME=/usr/bin/java
Environment=CATALINA_HOME=/opt/tomcat/tomcat9
Environment=CATALINA_BASE=/opt/tomcat/tomcat9
Environment=CATALINA_OPTS=
Environment="JAVA_OPTS=-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:MaxPermSize=128m -Xms512m -Xmx512m"
ExecStart=/opt/tomcat/tomcat9/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
[Install]
WantedBy=multi-user.target
</pre>
</pre>



Version vom 11. Mai 2019, 12:25 Uhr

Tomcat 9

Download

auf https://tomcat.apache.org/download-90.cgi den Link für die aktuellste Version suchen und herunterladen:

wget http://mirror.klaus-uwe.me/apache/tomcat/tomcat-9/v9.0.19/bin/apache-tomcat-9.0.19.tar.gz

Installation

Zuerst einen Benutzer tomcat9 anlegen, siehe dazu auch System-Benutzer anlegen].

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

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

Environment=CATALINA_PID=/opt/tomcat/tomcat9/tomcat9.pid
Environment=TOMCAT_JAVA_HOME=/usr/bin/java
Environment=CATALINA_HOME=/opt/tomcat/tomcat9
Environment=CATALINA_BASE=/opt/tomcat/tomcat9
Environment=CATALINA_OPTS=
Environment="JAVA_OPTS=-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:MaxPermSize=128m -Xms512m -Xmx512m"

ExecStart=/opt/tomcat/tomcat9/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID

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

Links

https://linuxconfig.org/how-to-install-tomcat-9-on-debian-9-stretch-linux


Zurück zu Raspbian