CS
-
Post 요청이 Redirect 되면?CS/네트워크 2024. 4. 19. 21:28
HTTP 요청이 들어오면 HTTPS 요청으로 301 Redirect를 하고 있습니다. 이 때 http로 POST 요청이 들어오면 어떻게 될까요? 1. 301 - Moved Permanently 301로 리다이렉트 하는 경우, 브라우저마다 구현이 다를 수 있으나 보통 GET 요청으로 변환되어 요청이 전달됩니다. 이 과정에서 전송하고자 하는 데이터는 전송되지 않습니다. Post를 핸들링 하는 라우터에 Get으로 요청이 가기 때문에 405 Method Not Allowed를 받을 수 있습니다. 2. 308 - Permanent Redirect 308로 리다이렉트 하는 경우, 최초 요청의 메소드와 원문을 그대로 유지한 채로 Redirect를 시킵니다. 3. 적절한 사용처 따라서 301은 url에 변경을 가할 때..
-
-
가상화와 컨테이너화 기술의 비교CS/운영체제 2024. 1. 5. 12:17
가상화는 크게 3가지로 나누어서 생각해 볼 수 있습니다. Virtualization으로 불리는 type1, type2와 containerization으로 나뉘는 컨테이너화 기술이 있습니다. 3가지의 차이를 간단히 알아보겠습니다. Virtualization 제가 가상화를 아주 간단하게 표현하면, 한 컴퓨터에서 마치 여러 대의 컴퓨터를 사용하는 것처럼 공간을 나누는 기술이라고 할 것 같습니다. 실제 컴퓨터의 하드웨어 리소스를 여러 대의 가상 컴퓨터가 나눠쓰는 형태로 구현됩니다. 이 때 리소스 분배를 관리하는 컴포넌트를 hypervisor라고 하고, hypervisor의 위치에 따라서 bare-metal과 hosted로 구분 짓습니다. 1. Bare-metal hypervisor (type1) 'barefoo..
-
BST - Binary Search TreeCS/자료구조 2023. 12. 29. 01:09
요즘 프로그래밍을 공부하는 사람들을 만나면, 다들 '자료구조 = 코딩테스트 준비' 라는 생각을 하고 있는 것 같습니다. 저는 수학에 사칙연산이 기본이라면, 코드를 작성할 때는 자료구조가 그 역할을 한다고 생각하는데요. 이번에는 다양한 트리 중에 이진 검색 트리를 살펴보겠습니다. 1. BST 란? Binary Search Tree라는 이름에서 알 수 있듯이, BST는 일종의 Binary Tree 입니다. (부모가 2개 이하의 자식을 갖는 트리) 그리고 Binary Tree 중에 특정 조건을 만족하는 경우에 검색에 이점이 생기기 때문에, 이들을 따로 BST로 분류를 합니다. 2. 성립조건 성립 조건은 생각보다 간단합니다. '부모를 기준으로 부모 보다 작은 값은 왼편에, 부모 보다 큰 값은 오른편에 위치한다...
-
nginx - fcgiCS/웹 2023. 12. 26. 00:20
서블리을 사용하기 전에 사용했던 cgi 형태의 통신은 어떻게 작동했는지 확인해보는 글 입니다. cgi보다 개선된 fcgi를 사용하였습니다. nginx 설치 $ brew nginx /opt/homebrew/etx/nginx에 설치된다. /opt/homebrew/etx/nginx경로의 conf파일을 수정해야된다. nginx 실행 $ brew services start nginx $ brew services stop nginx 하지만 nginx 키워드로도 가능 $ nginx $ nginx -s stop $ nginx -s reload root 설정 /opt/homebrew/etx/nginx경로의 conf파일을 수정해야된다. 서버 scope 속에서 root 경로 설정 가능하다. 서버 scope 에서 root 설..
-
정적 웹서버에서 MVC까지CS/웹 2023. 12. 26. 00:10
1. 초기의 서버 왜 웹을 쓰는가? 1. 컴퓨터하나에 모든 정보를 담기에는 정보의 양도 많고 복잡도 증가 2. 원격지에 있는 정보를 가져와서 보고 싶음 그럼 서버가 뭐야? 1. 클라이언트가 요청하는 자료를 전달하는 프로그램 클라이언트는 자료가 있는 컴퓨터의 ip로 요청을 한다. 서버는 요청이 들어오면 자기 컴퓨터의 저장매체에서 해당 자료를 찾는다. 해당 자료를 읽어서 응답을 보내준다. html 혹은 파일 주요 서버 프로그램들은 뭐가잇어? 1. CERN httpd - 연구원 간의 자료 공유로 목적으로 시작 2. apache - 90 중반등장, 오픈 소스로 커뮤니티의 지원으로 가장 보편화 (프로세스 기반) 3. nginx - 00 이후 등장 (이벤트 기반 아키텍쳐) 클라이언트 요청의 다양성, 복잡성 증가 1..
-
Observer 패턴 - Poll을 Push로!!CS/디자인패턴 2023. 12. 25. 23:56
목차 빠른 요약 옵저버 패턴 3장 그림 요약 시나리오 코드 Poll을 Push로!! 프로그래밍을 하다보면 a객체의 상태에 의존하여 b객체가 변경되어야하는 경우들이 생긴다. 보통은 b객체에서 a에게 '너의 상태가 변경되었니?' 물어보며 상태변화를 확인한다.(Poll) 하지만 언제 변할지 모르는 상태를 확인하기위해 몇 번을 얼마의 간격으로 물어봐야할까? 이런 문제를 a객체가 변경이 발생했을 때 '나 변했다~'를 b객체에게 알려주는 형태를 사용하면서 해결할 수 있다.(push) 이런 컨셉을 구현한 방법이 옵저버 패턴이다. 이번 글과 다음 글을 통해서 구체적인 예시를 확인해보자~ 그림으로 보면? A객체의 변화를 B객체가 알고 싶을 때 A객체의 변화를 여러개의 객체가 알고 싶을 때 유튜브 알림설정을 해보자 내가 ..
-
컴퓨터는 어떻게 작동할까 <2 - Register & RAM>CS/하드웨어 2023. 12. 21. 04:06
좋은 영상들을 찾게되서 시작했는데,, 책으로 돌아가야할 것 같네요. 이전 회사 CTO님께서 FlipFlop도 몰라서 되겠냐는 이야기를 하셨었는데, 이제서야 이런게 있구나 싶습니다 ㅎㅎ. 이번 글에서는 어떻게 구성되어있는지 하드웨어 레벨에서 살펴보고, 작동 매커니즘은 다음 글에서 적어보겠습니다. 이 시리즈들은 아래 영상에 기반하고 있습니다. 논리회로에 대한 내용 출처 by 정선생 Register에 대한 내용 by CrashCorse 전반적인 cpu 실행 흐름 영상 by bRd 3D 비트를 저장한다? 이런 생각은 누가 처음에 했나 참 대단한 것 같다. Latch는 비트를 임시로 저장할 수 있는 논리회로 장치 (이후 글의 진행은 AND-OR-LATCH를 기준으로 합니다.) 1. SR-Latch SR(0,0) ..