Where do I make a mistake? Which log file I should looking for the problem? I write yet lot of forums but nobody can help...
*(If I use tomcat 9.0.14 I have an error message in catalina.out: OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appr opriately using -XXarallelGCThreads=N But this I can fix it with change in the 14.point config file(/etc/systemd/system/tomcat.service ) this one:
-XXarallelGCThreads=N
for this: -XX:-AssumeMP Because I use virtual server on Digital Ocean and I have one processor.)*
BUT it's not needed if I use Tomcat 8.5.37
So I use now this step by step...
0.
[root@centos-s-1vcpu-1gb-ams3-01 ~]# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
1.
wget http://xenia.sote.hu/ftp/mirrors/ww...cat-8/v8.5.37/bin/apache-tomcat-8.5.37.tar.gz
2.
tar xzf apache-tomcat-8.5.37.tar.gz
3.
mv apache-tomcat-8.5.37/ /opt/tomcat
4.
groupadd tomcat
5.
useradd -g tomcat -M -d /opt/tomcat -s /bin/nologin tomcat
6.
chgrp -R tomcat /opt/tomcat/
7.
chmod -R g+r /opt/tomcat/conf
8.
chmod -R g+x /opt/tomcat/conf
9.
chown -R tomcat /opt/tomcat/webapps/
10.
chown -R tomcat /opt/tomcat/work/
11.
chown -R tomcat /opt/tomcat/temp/
12.
chown -R tomcat /opt/tomcat/logs/
13.
vi /etc/systemd/system/tomcat.service
14.
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
15.
systemctl daemon-reload
16.
systemctl start tomcat
17.
systemctl status tomcat
*(If I use tomcat 9.0.14 I have an error message in catalina.out: OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appr opriately using -XXarallelGCThreads=N But this I can fix it with change in the 14.point config file(/etc/systemd/system/tomcat.service ) this one:
-XXarallelGCThreads=N
for this: -XX:-AssumeMP Because I use virtual server on Digital Ocean and I have one processor.)*
BUT it's not needed if I use Tomcat 8.5.37
So I use now this step by step...
0.
[root@centos-s-1vcpu-1gb-ams3-01 ~]# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
1.
wget http://xenia.sote.hu/ftp/mirrors/ww...cat-8/v8.5.37/bin/apache-tomcat-8.5.37.tar.gz
2.
tar xzf apache-tomcat-8.5.37.tar.gz
3.
mv apache-tomcat-8.5.37/ /opt/tomcat
4.
groupadd tomcat
5.
useradd -g tomcat -M -d /opt/tomcat -s /bin/nologin tomcat
6.
chgrp -R tomcat /opt/tomcat/
7.
chmod -R g+r /opt/tomcat/conf
8.
chmod -R g+x /opt/tomcat/conf
9.
chown -R tomcat /opt/tomcat/webapps/
10.
chown -R tomcat /opt/tomcat/work/
11.
chown -R tomcat /opt/tomcat/temp/
12.
chown -R tomcat /opt/tomcat/logs/
13.
vi /etc/systemd/system/tomcat.service
14.
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
15.
systemctl daemon-reload
16.
systemctl start tomcat
17.
systemctl status tomcat
- Error:
tomcat.service - Apache Tomcat Web Application Container Loaded: loaded (/etc/systemd/system/tomcat.service; enabled; vendor preset: dis abled) Active: activating (auto-restart) (Result: exit-code) since Fri 2019-02-08 07:3 7:49 UTC; 1s ago Process: 3198 ExecStop=/bin/kill -15 $MAINPID (code=exited, status=1/FAILURE) Process: 3185 ExecStart=/opt/tomcat/bin/startup.sh (code=exited, status=0/SUCCES S) Main PID: 3196 (code=exited, status=0/SUCCESS)
Feb 08 07:37:49 centos-s-1vcpu-1gb-ams3-01 systemd[1]: Unit tomcat.service ente... Feb 08 07:37:49 centos-s-1vcpu-1gb-ams3-01 systemd[1]: tomcat.service failed. Hint: Some lines were ellipsized, use -l to show in full.