웹서버 이야기/기타

[SERVER] IIS8, Tomcat8 Connector 설정

한희성 2023. 7. 22.

목차

    반응형
    1.  개요
      1. 정의
        1. 특정 포트로 서비스가 수행되는 Tomcat을 80포트에서 서비스 
      2. 동작
        1. client는 특정 도메인 예) http://pmir.megic.co.kr 에 접근
        2. IIS에서 해당 요청을 Connector을 통해 설정된 Tomcat로 Rediect(http://pmir.megic.co.kr:9081/)
        3. 내부적인 처리를 통해 http://pmir.megic.co.kr 에서 응답을 보여줌
    2. 설정 개요 
      1. 참고사이트
      2. IIS에 Connector관련 설정 
        1. 특정 도메인을 서비스하기 위해 Vitual Host설정 후 Connector연동
        2. Vitual Host 설정(iis에서 웹사이트 추가)
        3. Vitual Host 설정 시 서비스 디렉토리는 더미로 하나 생성 (빈폴더)
        4. Connector설정을 위한 설정 폴더 생성 및 설정 (Woker등)
        5. Tomcat의 AJP port 설정
    3. 설정 세부
      1. IIS
        1. Connector 다운로드
        2. connector 위치 설정 (각 서비스마다 connector이 하나씩 필요함)
        3. connector 파일 설정
          1. isapi_redirect.properties (빨간 부분을 현 폴더에 맞춰줌)
          2. # Configuration file for the Jakarta ISAPI Redirector


            # The path to the ISAPI Redirector Extension, relative to the website
            # This must be in a virtual directory with execute privileges
            extension_uri=/jakarta/isapi_redirect.dll


            # Full path to the log file for the ISAPI Redirector
            log_file=D:\tomcat_iis_connector\s08040.aicro.megic.co.kr\logs\isapi_redirect.log


            # Log level (debug, info, warn, error or trace)
            log_level=info


            # Full path to the workers.properties file
            worker_file=D:\tomcat_iis_connector\s08040.aicro.megic.co.kr\conf\workers.properties.minimal


            # Full path to the uriworkermap.properties file
            worker_mount_file=D:\tomcat_iis_connector\s08040.aicro.megic.co.kr\conf\uriworkermap.properties


            rewrite_rule_file=D:\tomcat_iis_connector\s08040.aicro.megic.co.kr\conf\rewrites.properties
          3. conf/uriworkermap.properties
            어떤 요청에 대해서 worker1(tomcat)가 처리할 것인지 결정
            과거의 경우 정적인 것은 apache, 동적인 것은 tomcat가 처리하였으나
            최근 tomcat의 성능향상으로 크게 상관은 없을 것으로 보임
            아래 주황색 설정은 기본이므로 안바꿔도 됨
          4. # uriworkermap.properties - IIS
            #
            # This file provides mappings for the workers
            # defined in workermap.properties.minimal.
            # The general syntax for this file is:
            # [URL]=[Worker name]


            /*=worker1



          5. conf/workers.properties.minimal
            worker설정 : port가 tomcat의 ajp port와 맞아야함
          6. # workers.properties.minimal -
            #
            # This file provides minimal jk configuration properties needed to
            # connect to Tomcat.


            #
            # The workers that jk should create and work with.
            #
            worker.list=worker1


            #
            # Defining a worker named worker1 and of type ajp13.
            # Note that the name and the type do not have to match.
            #
            worker.worker1.type=ajp13
            worker.worker1.host=localhost
            worker.worker1.port=8045

        4. tomcat설정
        5. <!-- Define an AJP 1.3 Connector on port 9610 --> <Connector port="8045" address="127.0.0.1" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" tomcatAuthentication="false" URIEncoding="UTF-8" />
        6. 여기서부터는 IIS에 connector lib를 연동하기 위해 이해를 못한채 수행하는 부분임
          1. 웹사이트 추가
            1. 실제경로는 각 서비스마다 빈 폴더 생성 (windows는 안 생성하고 진행안됨)
              • 서비스는 tomcat으로 연결할 것이라 파일 필요없을 것이라 생각
            2. 응용프로그램 풀 생성 : 이후 이 풀마다 작업 추가 필요
            3. 서비스 domain을 host이름으로 추가
          2. 1의 웹사이트에서 ISAPI 필터 더블클릭
            1. 추가
            2. 필터이름 : tomcat (이름 무관)
            3. 실행파일 : 1~3에 설정된 connector(D:\tomcat\s08040.aicro.megic.co.kr)의 isapi_redirect.dll선택
          3. 1의 웹사이트에서 가상디렉토리추가
            1. 별칭 : jakarta (이름이 중요해보임. isapi_redirect.properties설정파일에 있음)
              실제경로 :  1~3에 설정된 connector위치(D:\tomcat\s08040.aicro.megic.co.kr)
          4. 1의 웹사이트에서 처리기매핑 더블클릭
            1. 기능사용권한 편집 - 실행 클릭
              =>예전 현재 클릭 안된 상태에서도 서비스 지장없음 (기존 153번 pmir)
          5. IIS서버에서 (최상단) ISAPI 및  CGI제한 더블클릭
            이부분은 IIS당 하나이기에 최초 한번 설정으로 모두 공유가능한 것으로 생각되었으나
            각 폴더별 dll이 다 다르게 작동하여 매번 작업해야함
            1. 추가
            2. ISAP또는 CGI경로 : connector의 위치(D:\tomcat\s08040.aicro.megic.co.kr) 의 isapi_redirect.dll
              설명 : s08040.aicro.megic.co.kr
            3. 확장 경로 실행 허용(A) 체크
          6. 응용프로그램풀 - 각각 새로 생성된 pool
            1. 고급설정
            2. 32비트 응용 프로그램 사용 true (무슨기능인지 전혀 모름)
          7. 1의 웹사이트에서 요청필터링선택
            1. 기능설정편집
            2. 이중 이스케이프허용 (정확히 모르나 해야할 것으로 보임 - 운영중 인코딩에러가능성)
    4. 위의 과정을 Tomcat의 80사용원하는 모든 서비스마다 해주어야함

     

    반응형

    댓글