AWS 배포절차(cafe24 → aws로 변경)
- 프론트 빌드
- 프론트 빌드 파일 서버 소스에 옮김
- 서버소스 jar 파일 생성
- intelij → Gradle > Task > build > bootJar
- aws 인스턴스 연결로 서버 접속
- 설명 따라서 터미널 접속
- 설명따라 파일질라로 aws 서버 접속
- aws 명령어
sudo su
sudo chmod 777 /tmp
cd backend
ls
ps -ef | grep java
kill -15 ID
nohup java -Dserver.port=80 -jar ROOT.jar &
cd backend
tail -n 200 nohup.out
# 실행중 포트 확인
netstat -tnlp
# 포트번호로 죽이기
sudo fuser -k 80/tcp
// 엔지닉스 관련 명령어(엔지닉스 사용하지 않아서 사용하지는 않음. 초기만 적용 검토)
// 기타 명령어들
// ngnix 설정 파일 수정 :q! :wq
sudo vi /etc/nginx/sites-available/silverbulletstock
// 테스트
sudo nginx -t
// 재시작
sudo systemctl restart nginx
// 서버 내리기
sudo systemctl stop nginx
// 서버 기동
sudo systemctl start nginx
- 파일질라로 ROOT.war 업로드
server {
listen 80;
server_name silverbulletstock.com www.silverbulletstock.com;
location / {
proxy_pass <http://silverbulletstock.com:8080>;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Optional: Handle WebSocket connections
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Optional: Handle static files or additional locations
location /static/ {
alias /var/www/html/static/;
}
# Optional: Error page handling
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
cafe24 배포절차(구서버)
- 프론트 빌드