1. tomcat 사이트에서 다운로드

https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.38/bin/

Untitled

2. 서버에 업로드

Untitled

3. 압축 해제

tar zxvf apache-tomcat-9.0.38.tar.gz

4. 이동

mv apache-tomcat-9.0.38 /usr/local/tomcat-9.0.38

5. systemd 등록

vi /usr/lib/systemd/system/tomcat.service
[Unit]
Description=Tomcat 9 servlet container
After=network.target
[Service]
Type=forking
Environment="JAVA_HOME=/usr/local/jdk-1.8.0_302"
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom"
Environment="CATALINA_BASE=/usr/local/tomcat-9.0.38"
Environment="CATALINA_HOME=/usr/local/tomcat-9.0.38"
Environment="CATALINA_PID=/usr/local/tomcat-9.0.38/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
ExecStart=/usr/local/tomcat-9.0.38/bin/startup.sh
ExecStop=/usr/local/tomcat-9.0.38/bin/shutdown.sh
[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl restart tomcat
systemctl enable tomcat

6. 테스트 페이지 접속

http://IP:8080

Untitled