전체 글
-
[AWS 자동 배포 시스템] 3. Jenkins를 활용한 S3 배포AWS 2022. 2. 16. 23:30
Jenkins Pipeline을 사용하여 S3에 웹 서버를 배포하려고 한다. 그냥 index.html 한개를 올리기에는 너무 간단하여 Vue를 이용하여 빌드 후 배포한다. Jenkins와 node가 설치되어 있다고 가정하에 진행한다. 먼저 빌드를 하기 위한 IAM 계정을 만들자. 추후 ECS 배포를 위한 권한(AmazonEC2ContainerRegistryFullAccess, AmazonS3FullAccess, AWSCodeDeployRoleForECS, AWSCodeDeployFullAccess)까지 추가하겠다. 발급 받은 엑세스 키 ID와 비밀 엑세스 키를 저장해놓자. Jenkins가 설치된 곳에서 사용할 예정이다 AmazonECS_FullAccess도 추가하자. Jenkins가 설치된 os에 jen..
-
[AWS 자동 배포 시스템] 2. 웹 서버(CDN) 구축(S3 + CloudFront + Route53 + ACM)AWS 2022. 2. 16. 23:30
프론트 웹 서버부터 구축하려고 한다. 구축 아키텍쳐는 S3 퍼블릭 엑세스를 차단하여 CloudFront를 통해서만 외부 접속이 가능하게 구현한다. 또 마지막으로 외부에서 구매한 도메인을 Route53 + ACM과 연동한다. 먼저 S3 버켓을 생성하자. 어려운 작업은 없다. 2022년 2월 16일 현재 기준으로는 버킷 이름만 입력 후 생성하면 된다. 리전은 서울로 하였다. S3 버킷 도메인으로는 직접 접근하지 않을 것으로 꼭 퍼블릭 엑세스를 차단하자. 버킷 생성 후 웹서버 테스를 위한 index.html를 업로드 해놓자. 샘플 코드를 넣어 놓겠다. Hello! Velnova! 다음으로 인증서를 생성하자. 인증서는 꼭 버지니아 북부 지역에서 생성해야한다. 그래야만 CloudFront에서 인증서를 가져올 수 ..
-
[AWS 자동 배포 시스템] 1. Route53 외부 도메인(호스팅케이알) 연결AWS 2022. 2. 16. 12:52
궁극적으로 AWS를 이용하여 프론트, 서버 자동 배포 시스템을 구축하려고 한다. 사용하는 AWS 서비스는 S3, CloudFront, ECS, ECR, VPC, RDS, Loadbalance, Route53, ACM 등을 사용하려고 한다. 장기 프로젝트로 여러 단계에 거쳐 진행하려고 한다. 이론 설명보다는 구축 방법을 적으려고 하니 이론의 대한 궁금함은 AWS 공식 설명을 읽기를 추천한다. 첫번째로 Route53과 호스팅케이알과 연동하려고 한다. Route53 호스팅 영역을 생성하자. 도메인 이름을 호스팅케이알에서 구매한 도메인을 입력한 후 생성한다. 다음으로 호스팅케이알 네임 서버를 Route53의 값(4개)으로 변경해준다. Route53과 외부 도메인과의 연결을 이제 끝났다. 다음부터는 Route53..
-
[Apache] Load Balancing 설정LINUX/Apache 2021. 7. 1. 22:49
오랜만에 포스팅을 작성한다. 이번 포스팅은 Apache에서 Load Balancing 설정하는 방법을 작성하려고 한다. Apache 2.4.29(Ubuntu) 기준으로 작성한다. 먼저 아래의 2개를 활성화해준다. # a2enmod proxy_balancer # a2enmod lbmethod_byrequests 아래를 참고하여 로드 밸런싱 설정을 추가한다. BalancerMember은 로드 밸런싱 할 WAS들의 IP:PORT를 설정한다. 필자는 WAS 2대로 로드 밸런싱 설정을 했다. # vim /etc/apache2/sites-available/000-default.conf ServerAdmin alsdud154@rigel.kr ServerName upbit.velnova.co.kr BalancerMem..
-
[Spring] CORS policy 에러 해결 방법SPRING 2020. 10. 29. 15:42
Vue.js[프론트 Port 3000]에서 Spring[백엔드 Port 8000]로 rest 통신을 하는 도중 CORS policy 에러가 발생하여 해결법을 작성한다. 먼저 Springframework-Version[4.2 이상] 과 Java-Version을 1.8로 업그레이드 한다. 필자는 4.3.26 버전으로 업그레이드했다. 그 다음 해당 RestController에 CrossOrign 어너테이션을 설정하면 끝난다. @CrossOrigin(origins = "http://localhost:3000") 다시 테스트 하면 정상적으로 Rest 통신이 된다.
-
[Jenkins] Jenkins 계정에서 다른 계정으로 ssh 설정카테고리 없음 2020. 10. 28. 13:46
이번 포스팅은 Jenkins 계정에서 다른 계정으로 ssh 설정을 하려고 한다. 먼저 다른 계정으로 .ssh 폴더를 생성한다. 필자는 tomcat 계정으로 설명한다. tomcat@~$ mkdir .ssh tomcat@~$ chmod 700 .ssh 그 다음 Jenkins 계정으로 접속 후 keygen을 발급 후 공개키를 tomcat 계정의 .ssh 폴더에 복사한다. scp로 복사 시 맨처음에 yes를 해줘야 Jenkins에서 빌드할 때 정상적으로 빌드가 됨으로 참고한다. 아직 공개키를 복사전으로 tomcat 계정의 비밀번호를 입력한다. jenkins@~$ ssh-keygen jenkins@~$ cd .ssh jenkins@~$ scp /var/lib/jenkins/.ssh/id_rsa.pub tomcat..
-
[Tomcat] 우분투 부팅 시 Tomcat 다른 계정으로 자동 실행LINUX/Tomcat 2020. 10. 21. 10:07
이번 포스팅에서는 우분투 부팅시 Tomact을 root가 아닌 다른 계정으로 자동 실행하려고 한다. 전에 필자가 쓴 포스팅을 참고하고 /etc/init.d/ 에 만든 파일 설정을 아래와 같이 하면 된다. start 부분만 확인하면 된다. 먼저 본인 계정으로 로그인 후 -c 옵션을 사용하여 Tomcat을 실행하면 된다. #!/bin/bash ### BEGIN INIT INFO # Provides: tomcat # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: auto start Tomcat server # ..
-
[Jenkins] Windows Jenkins 설정LINUX/Jenkins 2020. 10. 20. 13:01
프로젝트 중 윈도우 Jenkins를 사용하는데 우분투와 Execute Shell 설정이 달라 포스팅한다. Windows Jenkins 설치는 간단함으로 생략한다. 또 tomcat을 미리 설치해야 진행 할 수 있다. 다른 부분은 동일하고 Windows는 Execute Shell을 사용하지 않고 Execute Windows batch command를 사용해야 한다. 그래야지만 정상적으로 cmd에 명령을 내린다. 그리고 설정 내용도 우분투와 다르기 때문에 아래 명령어를 참고하여 설정하면 된다. echo " " echo "========================" echo "Stop tomcat" echo "========================" "C:\Program Files\Apache Softw..