Ubuntu 18.04 sunucunuza java 1.8 ve tomcat8 kurulumu için aşağıdaki adımlar izlenebilir:

ADIM 1::

# sudo add-apt-repository ppa:webupd8team/java
# sudo apt update
# sudo apt install oracle-java8-installer

License Accept: Yes

# apt install oracle-java8-set-default
# java -version

ADIM 2::

# useradd -m -d /home/applicationuser applicationuser -s /bin/bash
# cd /home/applicationuser/
# wget http://ftp.itu.edu.tr/Mirror/Apache/tomcat/tomcat-8/v8.0.53/bin/apache-tomcat-8.0.53.tar.gz
# mv apache-tomcat-8.0.53.tar.gz tomcat8
# chown applicationuser:applicationuser tomcat8 -R
# rm -r tomcat8/webapps/ROOT/* (web üzerinden kullanmak istemiyorsanız bunu uygulayın)
# vi tomcat8/webapps/ROOT/index.html
IT Works!
:wq

ADIM 3::

# vi /etc/systemd/system/tomcat.service


[Unit]

Description=Apache Tomcat Web Application Container

After=network.target

[Service]

Type=forking

#Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre/bin/  (java repodan kurulduğu için buna gerek kalmayacaktır.)
Environment=CATALINA_PID=/home/applicationuser/tomcat8/temp/tomcat.pid
Environment=CATALINA_HOME=/home/applicationuser/tomcat8
Environment=CATALINA_BASE=/home/applicationuser/tomcat8
LimitNOFILE=65536
Environment=’CATALINA_OPTS=-Xms4096M -Xmx4096M -server -XX:+UseParallelGC’
#Environment=’JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom’

ExecStart=/home/applicationuser/tomcat8/bin/startup.sh
ExecStop=/home/applicationuser/tomcat8/bin/shutdown.sh

User=applicationuser
Group=applicationuser
UMask=0007
RestartSec=10
Restart=always


[Install]
WantedBy=multi-user.target

ADIM 4::

# systemctl daemon-reload
# systemctl start tomcat
# ps -ef | grep java

Kolay Gelsin…