728x90
๊ฐ๋จํ๊ฒ ์๋ฒ ๋ฐฐํฌ ๋ฐ ๋ฌด์ค๋จ ๋ฐฐํฌํ ๊ฒ์ ์ ๋ฆฌํด๋ณด๊ณ ์ ํ๋ค.
sudo su
# update
sudo apt update
# nginx proxy server ์ฌ์ฉํ ์์ ์ด๊ธฐ ๋๋ฌธ์ nginx ๋ค์ด
sudo apt install nginx
# domain ์ฐ๊ฒฐ ๋ฐ proxy server ์ฐ๊ฒฐ
# default ํ์ผ ๋ณ๊ฒฝ
vim /etc/nginx/sites-avaliable/default
# default file ๋ด๋ถ
server_name _; # ์ด๋ถ๋ถ์ ์ํ๋ ๋๋ฉ์ธ ์ฐ๊ฒฐ
location ~~{
# 404 ๋ญ์๊ธฐ ์ฃผ์ ์ฒ๋ฆฌ
proxy_pass http://localhost:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
#nginx test
sudo nginx -t
#nginx ๋ณ๊ฒฝ ๊ฐ ์ ์ฉ
sudo service nginx restart
Spring boot์์ ๋ก๊ทธ์์์, redis๋ฅผ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ ์ด ๋ํ ๋ค์ด ๋ฐ๊ณ port๋ฅผ ์ด์ด์ค์ผํ๋ค.
sudo add-apt-repository ppa:redislabs/redis
sudo apt=get update
sudo apt-get install redis
apt install net-tools
netstat -ntlp | grep 6379
# 6379 port๊ฐ ์ผ์ง์ง ์์ ๊ฒฝ์ฐ
sudo systemctl restart redis-server
์ํ๋ ํ์ผ๋ก ์ด๋ํด์ git์ ์๋ repository๋ฅผ clone ํด์ค๋ค.
git --version
# ๋ค์ด์ด ๋์ด ์์ง ์๋ค๋ฉด ๋ค์ด๋ก๋
git clone "git ์ฃผ์"
chmod +x gradlew
./gradlew clean build -x test
#build success ์
java -jar build/libs/~~~~-SNAPSHOT.jar
# ๋ฌด์ค๋จ ๋ฐฐํฌ
nohup java -jar build/libs/~~~~-SNAPSHOT.jar &
# ๋ฌด์ค๋จ ๋ฐฐํฌ terminate
kill -15 [pid ๋ฒํธ]
728x90