인스턴스를 웹 서버로 사용하기 위해서 웹 서버가 사용할 포트를 개방해야 한다. 1. 컴퓨트 -> 인스턴스 -> 인스턴스 세부정보 -> 인스턴스 정보 탭 -> 기본 VNIC -> 서브넷 클릭 2. 보안 목록 -> 보안 목록 세부정보 -> 수신 규칙 추가 1. 소스 CIDR : 방화벽에서 허용하는 IP 범위. 0.0.0.0/0를 입력하면 모든 IP에서 접속 가능. 2. IP 프로토콜 : TCP 3. 대상 포트 범위 : 개방하고자 하는 포트 입력 참고 https://technfin.tistory.com/entry/%EC%98%A4%EB%9D%BC%ED%81%B4-%ED%81%B4%EB%9D%BC%EC%9A%B0%EB%93%9C-%ED%8F%AC%ED%8A%B8-%EA%B0%9C%EB%B0%A9%ED%95%98..
i18n internationalization의 축약형 총 20자리 글자 중에 맨 앞 i와 맨 뒤 n을 제외한 나머지가 18글자가 있다고 해서 i18n 이다. MessageSource란? 국제화(i18n)를 지원하는 스프링 인터페이스 하나의 메세지에 대해서 다국어로 표시해주는 기능 제공 Entity 생성 @Entity @Getter @Setter public class Languages { @Id @GeneratedValue private Integer id; private String locale; private String messageKey; private String messageContent; } sample data 생성 쿼리 작성 src/main/resources 경로에 data.sql 파일..
docker 폴더 생성 mkdir docker cd docker docker 폴더에 "docker-compose.yml"과 ".env" 작성 docker-compose.yml을 git에 push할 경우 비밀번호가 노출되기 때문에 환경 변수로 설정해야 한다. docker-compose는 기본적으로 .env 파일을 환경 변수 파일로 인식된다. .env 파일을 작성하고 .gitignore에 추가한다. services: mariadb: container_name: mariadb image: mariadb:10.8.3 restart: always environment: - MYSQL_ROOT_PASSWORD=${MARIADB_PASSWORD} MARIADB_PASSWORD=mypassword 컨테이너 실행 doc..
오라클 인스턴스 생성 SSH 접속 터미널에서 SSH 접속 ssh ubuntu@[주소] $HOME/.ssh 경로에 private key가 저장되어 있기 때문에 암호를 입력하지 않아도 원격 서버에 접속할 수 있다. 만약 private key가 $HOME/.ssh 경로에 위치하지 않은 경우 ssh -i [private key path] ubuntu@[주소] 참고 https://opentutorials.org/module/432/3742 https://iter.kr/%EC%98%A4%EB%9D%BC%ED%81%B4-%ED%81%B4%EB%9D%BC%EC%9A%B0%EB%93%9C-%EC%9D%B8%EC%8A%A4%ED%84%B4%EC%8A%A4-%EC%83%9D%EC%84%B1/
설치 환경 Ubuntu 22.04 LTS 이전 버전 Docker 삭제 sudo apt-get remove docker docker-engine docker.io containerd runc Docker 저장소 설치 Docker Engine을 설치하기 전에 Docker 저장소를 설치해야 Docker를 설치하고 업데이트할 수 있다. 1. apt 패키지를 업데이트 하고 apt가 HTTPS를 통해 저장소를 사용할 수 있도록 패키지를 설치 sudo apt-get update sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release 2. Docker의 공식 GPG 키 추가 sudo mkdir -p /etc/apt/keyrings curl -fsSL h..
얼마전 동료한테 디버깅 요청을 받았다. 어떤 값을 받아서 크기를 비교해서 예외를 처리하는 구문이었는데 테스트를 진행하면 예상과 반대의 결과가 나왔다. 나는 1초만에 감이 왔다. 오버플로우... 바로 Long 타입으로 바꿔보라고 말했고 바로 해결할 수 있었다. 그러면 오버플로우가 발생하면 값이 어떻게 되었길래 예상과 다른 결과가 나왔을까? 분명 예전에 공부하면서 알았지만 기억나지 않아서 다시 테스트해본다. Integer란? 자바의 정수형 타입 중 하나이다. 크기 -2147483648 ~ 2147483647 테스트1 int maxValue = 2147483647; int minValue = -2147483648; System.out.println(maxValue); System.out.println(minV..
기존 AdoptOpenJDK는 Apple Silicon을 지원하지 않기 때문에 Apple Silicon을 지원하는 Zulu JDK로 교체한다. 기존 JDK 제거 cd /Library/Java/JavaVirtualMachines/ ls adoptopenjdk-11.jdk sudo rm -rf adoptopenjdk-11.jdk /Library/Java/JavaVirtualMachines/ 경로로 이동 후 현재 설치되어 있는 JDK 폴더를 확인한다. ex)JDK종류-버전.jdk 기존에 설치된 JDK를 rm -rf 명령어로 제거한다. Zulu JDK 설치 환경변수 설정 기존 JDK가 설치되어 있던 /Library/Java/JavaVirtualMachines/ 경로로 가보면 새로 설치한 Zulu JDK 폴더가 ..
문제 sudo: no tty present and no askpass program specified. 메세지가 나오면서 CI/CD가 안 될 경우 해결 sudo vi /etc/sudoers 명령어로 파일을 열어서 아래 내용을 스크린샷과 같은 위치에 추가한다. gitlab-runner ALL=(ALL) NOPASSWD: ALL E45: 'readonly' option is set (add ! to override) 메세지가 나오면서 저장이 안 될 경우 :w! 명령어로 강제 저장한다. 문제 Job's log exceeded limit of 4194304 bytes. Job execution will continue but no more output will be collected. 위 에러는 gitlab-r..