Skip to content

Instantly share code, notes, and snippets.

@limjinsun
Last active September 8, 2018 03:20
Show Gist options
  • Select an option

  • Save limjinsun/5bece136e4da6ce88d488e84bb5106cd to your computer and use it in GitHub Desktop.

Select an option

Save limjinsun/5bece136e4da6ce88d488e84bb5106cd to your computer and use it in GitHub Desktop.

자바 스프링 jar파일 디플로이할때 셋업 샘플

/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment