2020/04

nginx 기본 설정 설정 파일 nginx.conf : 기본 환경 설정 mime.types : 파일 확장명과 MIME 타입 목록 fastcgi.conf : FastCGI관련 설정 proxy.conf : 프록시 관련 설정 sites.conf : 엔진엑스에 의해 서비스되는 가상 호스트 웹사이트의 설정. 도메인마다 파일을 분리할 것을 권장 지시어 블록 지시어는 모듈에 의해 도입된다. 새 모듈을 활성화하면 그 모듈에 포함된 지시어들을 사용할 수 있다. # 이벤트 모듈에서 사용하는 환경설정 정보 events { worker_connections 1024; } # 블록은 중첩이 되며, 설정은 자식 블럭에 상속된다. http{ server { access_log /var/log/nginx/example.com.log..
SSL 설정 upstream backend{ # upstream 설정 ip_hash; server 127.0.0.1:9000 fail_timeout=30s; } server{ listen 80; server_name www.corn-sample.com corn-sample.com; location / { root /usr/local/var/www/frontend; index index.html; } location ^~/api { proxy_pass http://backend; } error_page 500 502 503 504 /50x.html; location /50x.html { root html; } } server{ #listen 443; listn 443 ssl; server_name www...
Nginx + Tomcat 연동 Upstream apache를 사용하면 tomcat서버와 AJP설정을 통해서 통신을 하게 되는데, nginx는 tomcat서버와 HTTP 통신을 하게된다. Nginx는 Upstream이란 지시자를 사용하며, reverser proxy 역할을 하게된다. upstream이란 무엇일까? Upstream 서버는 다른 말로 Origin 서버라고도 부른다. 여러대의 컴퓨터가 순차적으로 어떤 일을 처리할 때 어떤 서비스를 받는 서버를 의미한다. 위의 그림에서 업스트림 서버는 PHP-FPM이 설치된 서버이고, Nginx는 DownStream 서버라고 할 수 있다. Upstream Module 업스트림 모듈은 Nginx에 내장된 모듈로 부하분산, 속도 개선과 같은 역할을 할 수 있게 한다..
nginx에 가상호스트틀 설정해보자. 호스트 도메인은 corn-sample.com이다. hosts 파일 수정 127.0.0.1 corn-sample.com 127.0.0.1 www.corn-sample.com 가상호스트 설정 가상호스트 파일은 별도의 디렉토리에 두는 것이 보기 좋으니 nginx conf 홈파일에 servers라는 디렉토리를 만들어서 nginx.conf파일에 servers 디렉토리 파일을 include하게 한다. # /usr/local/etc/nginx/nginx.conf http{ ... include servers/*; # 가상호스트설정파일 경로 추가 } # /usr/local/etc/nginx/servers/corn-sample.conf server { listen 80; server..
Apache는 모든 개발자들에게 친근할 거다.(Nginx에 비해) Nginx가 왜 요즘 뜨고있는 HTTP서버인지, 자료를 조금 조사해보았다. (왜냐면 이제 Nginx 사용해볼거거든..) Apache Apache는 Client 요청을 받으면 MPM(Multi Processing Module : 다중처리모듈)이라는 방식으로 요청을 처리하며 대표적으로 Prefork와 Work방식이 있다. Apache 2.4에 Event 방식이 나왔지만, Worker방식과 비슷한것으로 알고있다. 아닌가? 일단 스레드/프로세스 기반구조에 대해 알아보자. 스레드/프로세스 기반 구조 ServerSocket으로 request A가 들어오면 Thread를 할당해 준다. Thread는 그 socket을 가지고 read, write 작업(..
아파치가 버전이 업될때 마다, 살펴볼 것이 많고 설정파일도 무척 복잡하여 nginx를 써보기로 했다. nginx가 가볍고 설정파일이 아파치에 비해 무척 쉽다는 소문만 들었다.. 삽질을 시작해보자. 일단 내 PC인 맥북에 nginx를 설치해보자! 홈브루(homebrew) 설치 사실 macOS에 많이 익숙하진 않다. 홈브루(homebrew)는 yum, apt-get 과 같은 패키지 관리 프로그램이다. 맥북에 설치해보자 $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" terminal에 위의 명령어를 복붙해서 실행하면, 쭈르르륵 뭔가 설치되는 것이 보인다.. 주르륵 내려가다가 "Press RETU..
몸풀기 living : (noun) 생활, 생계 unemployed : (adjectvie) 실직의 address : (verb) ~ 라고 부르다. get in touch : (idiom) 연락을 취하다. Dialogue A : What do you do for a living? B : I'm unemployed at the moment. How about you? A : I'm a web designer A : I don't know to address you. B : Jane will be fine. A : Okay, then how can I get in touch with you? A : Just e-mail me. Pattern 연습하기 I don't know how..
몸풀기 allow : (verb) 허락하다. mine : (pronoun) 나의 것 terrible : (adjective) 서투른, 약한 pleasure : (noun) 즐거움, 기쁨 Allow me to inroduce myself : 제 소개를 할께요. The pleasure is all mine : 제가 더 기쁘네요(천만에요), 저도요 I'm terrible at names : 제가 이름을 잘 못 외우거든요. It's a pleasure to meet you : 만나서 반갑습니다. Dialogue A : Allow me to introduce myself. My name is Jeff Daniels. B : Nice to meet you, Daniels. My name is Nico..
Write about a fun party you went to. Who was the party? What did you do there? Why was it fun? I had a year-end company party last night. All the company employees were there. The award ceremony were held, and it was followed by an entertaining program. It was meaningful event. After the party, we had a free time to hang out with each other. hang out : 많은 시간을 보내다. What is the best way to keep in..
애노테이션 기반의 스프링 @AOP 의존성 추가 org.springframework.boot spring-boot-starter-aop 애스팩트 정의 @Aspect 빈으로 등록해야 하니까(컴포넌트 스캔을 사용한다면) @Component도 추가. 포인트컷 정의 @Pointcut(표현식) 주요 표현식 execution @annotation bean 포인트컷 조합 &&, ||, ! @Aspect @Component public class PerfAspect { // Advice + Pointcut @Around("execution(* com.corn..*.EventService.*(..))") public Object logPerf(ProceedingJoinPoint pjp) throws Throwable { ..
깡냉쓰
'2020/04 글 목록