(putty / intelliJ / filezilla 사용)
1. rds 생성 및 연결
https://dev-chw.tistory.com/26
https://rhdqors.tistory.com/32
db 작성후 보안그룹에서 3306포트르 열어둘것
사실상 내꺼 인스턴스랑만 접속하기 때문에 굳이 ip주소 세세하기 설정할 필요는 없는 듯 하다
rds 생성후 엔드포인트 복사
인텔리제이 데이터베이스 클릭 / datasource mysql 선택 (아마 지금까지 데이터를 썼으면 localhost로 db가 하나 있을거임)
name(db이름 지어두기), host(rds 엔드포인트 복붙), user(rds 생성시 사용한 id), passoword(rds 생성시 사용한 비밀번호), database(db이름)
이후 인텔리제이에서 런해서 연결되면 성공
결론 :
ec2인스턴스 생성 [백엔드용 인스턴스]
sudo apt-get update
sudo apt-get upgrade
git clone [git address]
cd [파일 이름]
ls 해서 build파일 확인하기
./gradlew build
cd build/libs
nohup java -jar buildName-0.0.1-SNOPSHOT.jar &
하지만 .. ./gradlew build에서 빌드가 안되는 에러 발생 ㅠ
https://velog.io/@rong5026/AWS-EC2-FileZilla-%EC%97%B0%EA%B2%B0
앞서 2번 수행 후에 jar 파일이 빌드가 안되는 것을 확인
윈도우 인텔리제이 상에서는 빌드가 완료되기때문에 우분투 상의 문제라고 생각
우분투상에서 에러 해결보다는 빌드 파일을 우분투로 옮기는게 더 빠르다고 판단..
인텔리제이에서 파일 build
.jar 파일 filizilla로 이동시키기
- 새타이틀 - 프로토콜(sftp) 로그온 유형(키파일) 사용자(ubuntu) 키파일(인스턴스 생성 및 푸티 사용할때 쓴 ppk파일)
filezilla에서 사용자는 aws에서 생성했을때 os를 뭐로 골랐는지에 따라 다름 난 우분투를 골랐기에 사용자가 ubuntu
** filezilla를 통해 파일 이동 후 푸티에서 ls를 통해서 .jar파일 들어왔는지 확인
https://rhdqors.tistory.com/32
nohup: ignoring input and appending output to 'nohup.out'
https://spartacodingclub.kr/community/fastqna/all/62fcc5d638e6ffe21f0b0b09/nohup%20%EC%98%A4%EB%A5%98
결론 : nohup : ignoring input and appending output to 'nohup.out' 메시지는 에러가 아니라 배포파일이 실행되고 있다는 뜻
postman or http상에서의 확인
ec2 복기하기
nginx 설치하기
https://dev-san.tistory.com/30
nginx react 올리기
https://sihus.tistory.com/31
nginx react 올리기2
https://blog.naver.com/PostView.nhn?blogId=dilrong&logNo=221497936351
server {
listen 80;
location / {
root /root/build/build; - build파일이 있는 경로 지정
index index.html index.htm; - index html 지정
server_name $uri; - 어떤 url이 들어와도 다 index html로 보내겟다
try_files $uri $uri/ /index.html;
}
}