본문 바로가기

전체 글99

[AWS] Application 백그라운드 nohup java -jar [application].jar 로 실행한 애플리케이션은 터미널 또는 ctrl + c 로 종료 된다. 하지만 우리는 둘의 상황에서도 살아남고 24시간 돌아가는 프로그램이 목적이기에 다음 명령어로 실행하지 nohup java -jar [application].jar & 2023. 1. 17.
[AWS] Amazon 리눅스 jdk 17 amazon-linux-extras는 java-openjdk11을 보여주는 상황으로 17 설치를 위해 검색 후 진행했다. 필요한 명령어 wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm sudo rpm -ivh jdk-17_linux-x64_bin.rpm sudo alternatives --config java java -version 3번째 명렁어 작성 시 17버전을 선택해주어야 한다. https://binux.tistory.com/122 Amazon Linux jdk 17 설치방법 검색해도 잘 안나와서 정리 wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64.. 2023. 1. 17.
[AWS] 서버에 파일 복사하기 pem KEY, 프로젝트 파일 명령어는 scp로 진행 scp -i [pem key 위치] [프로젝트 위치] ec2-user@[public IP]:[복사해둘 서버 파일 위치] 이후 서버에서 확인 2023. 1. 17.
[AWS] EC2 생성, SSH로 접근하기 기본적으로 ssh 키 생성 후 내가 보관하고 싶은 폴더로 옮겨두고 시작한다. mac Terminal pem키를 저장해둔 폴더 위치로 이동하자 chmod를 통해 파일 모드 변경 이후 ssh 접속 명령어를 통해서 접속하자. ssh -i [pemkey] ec2-user@[publicIP] 접속 성공이다. 2023. 1. 17.
[Spring Security] @Secured(ROLE_?) 본래 필터 단에서 requestMatcher(" ? ").hasRole(" ? ")로 작업을 진행했다. URL 하나하나 작업하는 부분이 생각보다 많은 시간을 요구하여 Spring Security에서 지원하는 @Secured로 작업 방향을 변경하기로 했다. 기존 SecurityConfig에서 조금 더 간소하게 바꾸고 @EnableMethodSecurity(securedEnabled = true, prePostEnabled = true) 어노테이션을 추가했다. https://docs.spring.io/spring-security/reference/servlet/authorization/method-security.html Method Security :: Spring Security Sometimes, yo.. 2023. 1. 13.
Security + JWT를 사용해보자 JWTGenerator, JWTValidator, SecurityConfig JWT생성 JWT 검증 검증 단계에서 주의할 부분은 Claims claims = Jwts.parser() .setSigningKey(key) .parseClaimsJws(jwt.replace("Bearer ", "").trim())//pass the jwt that we received .getBody(); // want to read body part of jwt token parseClaimsJws 자동완성으로 작성하면서 Jwt가 작성 되는 경우가 있는데 에러가 발생하기에 주의해주자. 또한 위의 jwt.replace("Bearer " , "").trim()을 작성했다. JWT 생성하면서 우리는 분명 생성한 JWT를 'Auth.. 2023. 1. 10.