Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

[오픈소스컨설팅]Nginx jboss 연동가이드__v1

2,142 views

Published on

This is a guide document for integration JBoss with nginx web server.

Published in: Technology
  • Be the first to comment

[오픈소스컨설팅]Nginx jboss 연동가이드__v1

  1. 1. Confidential[Megabox]Tomcat_설정보고서.docxLast printed on 4/2/2013 10:11:00 AMNginx + Jboss EAP Proxy 연동 가이드 문서Project Name: Nginx + Jboss 연동 가이드Department: 오픈소스 컨설팅 미들웨어Focus Area: Nginx proxy testProduct/Process: Nginx 1.2.7 Stable version + EAP 5.1.2Prepared By:Document Owner(s) Project/Organization RoleMan-Woong Choi Technical AssistanceProject Status Report Version ControlVersion Date Author Change Description1.0 2013/04/02 Man-Woong Choi Document created[Version #] [mm/dd/yy] [Change owner] [Change 1] [Change 2] [Change n]
  2. 2. Confiugration ReportConfidential Page 2 4/2/2013TABLE OF CONTENTS1 1. 본 문서의 목적 ......................................................................................................................31.1 작업 일시 ....................................................................................................................31.2 작업의 범위..................................................................................................................32 NGINX 연동전 설정 확인 ...........................................................................................................42.1 설치 시스템 정보 ...........................................................................................................42.2 설치 전 필수 사항 ..........................................................................................................43 NGINX 연동 설정.....................................................................................................................63.1 Configuration Nginx ..................................................................................................63.2 Nginx 의 재 기동..........................................................................................................83.3 Nginx 작동 상태 점검하기...............................................................................................84 NGINX + JBOSS EAP PROXY 연동 설정..............................................................................105 APPENDICES....................................................................................................................115.1 Document Guidelines .............................................................................................115.2 Project Migration Report Sections Omitted..............................................................111
  3. 3. Confiugration ReportConfidential Page 3 4/2/20131. 본 문서의 목적본 문서의 목적은 기존의 설치한 Nginx(Web Server)와 Jboss EAP 와의 연동에 필요한 내용을 정리한문서입니다.본 문서에는 Nginx 와 Jboss EAP 설치에 대한 정보는 별도로 없으며, Nginx 와 Jboss 연동에 대한정보만을 포함하고 있습니다.1.1 작업 일시구분 내용 시간 2013 년 4 월 3 일 오전 10 시~12 시 장소 오픈소스 컨설팅 본사 작업자 최만웅 차장(mwchoi@osci.kr) 담당 매니저 최지웅 이사(jchoi@osci.kr)1.2 작업의 범위작업에 대한 결과 리포트는 아래와 같은 내용을 포함하고 있습니다. Nginx 1.2.7 Configuration
  4. 4. Confiugration ReportConfidential Page 4 4/2/20132 Nginx 연동전 설정 확인2.1 설치 시스템 정보설치 시스템 정보는 다음과 같습니다. RHEL 6.4[mwchoi-vm01:/]# uname -aLinux mwchoi-vm01 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013x86_64 x86_64 x86_64 GNU/Linux[mwchoi-vm01:/]#2.2 설치 전 필수 사항Nginx + Jboss EAP 를 연동하기 위해서는 다음의 내용이 선행하여야 합니다.A. Nginx 설치[mwchoi-vm01:/data/nginx]# pwd/data/nginx[mwchoi-vm01:/data/nginx]# ls -altotal 32drwxr-xr-x. 8 root root 4096 Apr 2 15:04 .drwxr-xr-x. 9 root root 4096 Apr 2 15:04 ..drwxr-xr-x. 2 root root 4096 Apr 2 15:00 bindrwxr-xr-x. 2 root root 4096 Apr 2 17:50 confdrwxr-xr-x. 2 root root 4096 Apr 2 15:00 htmldrwxr-xr-x. 2 root root 4096 Apr 2 17:49 logsdrwxr-xr-x. 2 root root 4096 Apr 2 17:50 piddrwxr-xr-x. 7 root root 4096 Apr 2 16:47 tmp[mwchoi-vm01:/data/nginx]#B. Jboss EAP 설치[mwchoi-vm01:/data/was/eap/jboss-eap-5.1]# pwd/data/was/eap/jboss-eap-5.1[mwchoi-vm01:/data/was/eap/jboss-eap-5.1]# ls -ltotal 20drwxrwxr-x. 8 501 505 4096 Jun 22 2012 jboss-as
  5. 5. Confiugration ReportConfidential Page 5 4/2/2013drwxrwxr-x. 5 501 505 4096 Nov 11 2011 mod_clusterdrwxrwxr-x. 4 501 505 4096 Nov 11 2011 picketlinkdrwxrwxr-x. 4 501 505 4096 Nov 11 2011 resteasydrwxrwxr-x. 9 501 505 4096 Oct 14 2011 seam[mwchoi-vm01:/data/was/eap/jboss-eap-5.1]#C. Jboss EAP Instance 설정구분 http 도메인 디렉터리test1 8180 /data/was/eap/jboss-eap-5.1/jboss-as/server/test1test2 8280 /data/was/eap/jboss-eap-5.1/jboss-as/server/test2test3 8280 /data/was/eap/jboss-eap-5.1/jboss-as/server/test3test4 8280 /data/was/eap/jboss-eap-5.1/jboss-as/server/test4D. 연동 확인을 위한 test page 설정instance 명 테스트 파일 생성 경로 및 파일명test1 /data/was/eap/jboss-eap-5.1/jboss-as/server/test1/deploy/ROOT.war/test1/server_info.jsptest2 /data/was/eap/jboss-eap-5.1/jboss-as/server/test2/deploy/ROOT.war/test2/server_info.jsptest3 /data/was/eap/jboss-eap-5.1/jboss-as/server/test3/deploy/ROOT.war/test3/server_info.jsptest4 /data/was/eap/jboss-eap-5.1/jboss-as/server/test4/deploy/ROOT.war/test4/server_info.jspE. test page 내용<!doctype html public "-//w3c/dtd HTML 4.0//en"><html><head><title>Server Info</title></head><body bgcolor="#FFFFFF"><p><font face="Helvetica"><p><h1> Server Infomation </h1>server bind Address : <%=System.getProperty("jboss.bind.address")%><br>
  6. 6. Confiugration ReportConfidential Page 6 4/2/2013server Name : <%=System.getProperty("jboss.server.name")%><br><br>server Home : <%=System.getProperty("jboss.server.home.url")%><br><p>serverInfo : <%=request.getSession().getServletContext().getServerInfo() %><br>serverName : <%=request.getServerName() %><br>serverPort : <%=request.getServerPort() %><br>contextPath : <%=request.getContextPath() %><br></font><p></body></html>F. Jboss EAP 기동 확인[mwchoi-vm01:/data/was/eap]# ps -ef|grep javaroot 23084 23030 ./run.sh -b 0.0.0.0 -c test1 -Djboss.service.binding.set=ports-01root 23155 23101 ./run.sh -b 0.0.0.0 -c test2 -Djboss.service.binding.set=ports-02root 23229 23175 ./run.sh -b 0.0.0.0 -c test3 -Djboss.service.binding.set=ports-03root 23299 23245 ./run.sh -b 0.0.0.0 -c test4 -Djboss.service.binding.set=ports-043 Nginx 연동 설정3.1 Configuration Nginx실제 Nginx 와 Jboss 연동을 하기 위해서는 다음의 설정파일을 변경하여야 합니다.[mwchoi-vm01:/data/nginx/conf]# ls -ltotal 60-rw-r--r--. 1 root root 1034 Apr 2 15:00 fastcgi.conf-rw-r--r--. 1 root root 1034 Apr 2 15:00 fastcgi.conf.default-rw-r--r--. 1 root root 964 Apr 2 15:00 fastcgi_params-rw-r--r--. 1 root root 964 Apr 2 15:00 fastcgi_params.default-rw-r--r--. 1 root root 2837 Apr 2 15:00 koi-utf-rw-r--r--. 1 root root 2223 Apr 2 15:00 koi-win-rw-r--r--. 1 root root 3463 Apr 2 15:00 mime.types-rw-r--r--. 1 root root 3463 Apr 2 15:00 mime.types.default-rw-r--r--. 1 root root 3040 Apr 2 17:50 nginx.conf-rw-r--r--. 1 root root 2685 Apr 2 15:00 nginx.conf.default-rw-r--r--. 1 root root 596 Apr 2 15:00 scgi_params-rw-r--r--. 1 root root 596 Apr 2 15:00 scgi_params.default
  7. 7. Confiugration ReportConfidential Page 7 4/2/2013-rw-r--r--. 1 root root 623 Apr 2 15:00 uwsgi_params-rw-r--r--. 1 root root 623 Apr 2 15:00 uwsgi_params.default-rw-r--r--. 1 root root 3610 Apr 2 15:00 win-utf[mwchoi-vm01:/data/nginx/conf]#Jboss http 포트와 연동을 위해 proxy 설정 부분을 nginx.conf 파일에 추가합니다.[mwchoi-vm01:/data/nginx/conf]# vi nginx.confserver {listen 80;server_name localhost;location / {root html;index index.html index.htm;}###################### proxy config append #######################location /test1 {proxy_pass http://192.168.0.82:8180;}location /test2 {proxy_pass http://192.168.0.82:8280;}location /test3 {proxy_pass http://192.168.0.82:8380;}location /test4 {proxy_pass http://192.168.0.82:8480;}error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}}설치가 모두 되었다면 디렉토리를 확인합니다.[mwchoi-vm01:/data/nginx]# ls -ltotal 24drwxr-xr-x. 2 root root 4096 Apr 2 15:00 bin
  8. 8. Confiugration ReportConfidential Page 8 4/2/2013drwxr-xr-x. 2 root root 4096 Apr 2 15:00 confdrwxr-xr-x. 2 root root 4096 Apr 2 15:00 htmldrwxr-xr-x. 2 root root 4096 Apr 2 15:00 logsdrwxr-xr-x. 2 root root 4096 Apr 2 15:00 piddrwxr-xr-x. 2 root root 4096 Apr 2 15:01 tmp[mwchoi-vm01:/data/nginx]#3.2 Nginx 의 재 기동기존 Nginx 의 설정 정보 변경에 대한 적용을 위해서 다음의 명령어를 실행합니다.[mwchoi-vm01:/data/nginx]# cd bin[mwchoi-vm01:/data/nginx/bin]# ls -ltotal 5288-rwxr-xr-x. 1 root root 5414275 Apr 2 15:00 nginx[mwchoi-vm01:/data/nginx/bin]# ./nginx –s reload3.3 Nginx 작동 상태 점검하기[mwchoi-vm01:/data/nginx/bin]# ps –ef|grep nginxroot 20165 1 0 15:01 ? 00:00:00 nginx: master process nginxnobody 20166 20165 0 15:01 ? 00:00:00 nginx: worker processroot 20228 14774 0 15:08 pts/1 00:00:00 grep nginx브라우저를 통한 Nginx 를 통한 Jboss 에 deploy 된 페이지를 확인합니다.http://${webserver_IP:port}/test1/server_info.jsp
  9. 9. Confiugration ReportConfidential Page 9 4/2/2013정상적으로 보이는지 확인을 한 후 기타 test2, test3, test4 에 해당 하는 URL Mapping 에 따른 호출이정상인지를 확인합니다
  10. 10. Confiugration ReportConfidential Page 10 4/2/20134 Nginx + Jboss EAP Proxy 연동 설정Prepared by __________________________________Middleware Consultant, Open Source Consulting, Inc.Approved by __________________________________Project Manager
  11. 11. Confiugration ReportConfidential Page 11 4/2/20135 APPENDICES5.1 Document Guidelineshttp://wiki.nginx.org/NginxHttpProxyModule#proxy_pass5.2 Project Migration Report Sections OmittedN/A

×