/etc/systemd/system/luasjar.service root@vps584959:/etc/systemd/system# cat luasjar.service
[Unit]
Description=Spring Boot HelloWorld
After=syslog.target
After=network.target[Service]
User=username
Type=simple
[Service]
ExecStart=/home/liffey/jarfiles/luasjar.sh
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=helloworld
[Install]
WantedBy=multi-user.target/home/liffey/jarfiles/luasjar.sh root@vps584959:/home/liffey/jarfiles# cat luasjar.sh
#!/bin/sh
sudo /usr/bin/java -Dserver.port=8081 -jar /home/liffey/jarfiles/api-v1.jar server config.yml리눅스에 Tomcat 설치해주고 port 8081 오픈해주는 법
$ sudo ufw allow from any to any port 8081 proto tcp
톰캣 위치파일 참조 https://askubuntu.com/questions/135824/what-is-the-tomcat-installation-directory