사전 작업

모듈파일 위치 확인

웹로직의 아파치 모듈은 "Weblogic 설치 디렉토리/server/plugin/OS명" 디렉토리 에 위치함

WebLogic이 /home/weblogic/Oracle/Middleware/wlserver_10.3/에 설치되었을 경우 module 위치

PathOS비고
/home/weblogic/Oracle/Middleware/wlserver_10.3/server/plugin/linux/x86_64Linux x64 
/home/weblogic/Oracle/Middleware/wlserver_10.3/server/plugin/win/32Windows 32Bit httpd 가 32bit 일 경우

WebServer 별 Module 파일

파일명WebServer비고
mod_wl_20.soApache httpd 2.0 
mod_wl_22.so Apache httpd 2.2 

 

apache httpd용 Module 설치

  1. OS 에 맞는 connector 를 APACHE_HOME/modules 에 복사

    RHEL/CentOS

    cp /home/weblogic/Oracle/Middleware/wlserver_10.3/server/plugin/linux/x86_64/mod_wl_22.so /etc/httpd/modules
    BASH
  2. SELinux 를 사용할 경우 context 할당
    chcon -u system_u -r object_r -t httpd_modules_t /etc/httpd/modules/mod_wl_22.so
    CODE
  3. context 확인
    ls -lZ /etc/httpd/modules/mod_wl_22.so
    CODE

Configuration 변경 및 재구동

Non-Cluster

  1. httpd.conf 변경 

    httpd.conf

    ## Loading weblogic connector module
    LoadModule weblogic_module modules/mod_wl_22.so
    
    ## To proxy requests by path, use the Location block and the SetHandler statement. 
    ## SetHandler specifies the handler for the Apache HTTP Server Plug-In module. 
    ## For example the following Location block proxies all requests containing /weblogic in the URL:
    <Location /weblogic>
    	setHandler weblogic-handler
    	PathTrim /weblogic
    </Location>
    
    <IfModule mod_weblogic.c>
       # weblogic ip 로 변경
       WebLogicHost 127.0.0.1
       # weblogic port 로 변경
       WebLogicPort 7001
       MatchExpression /*
       #  Debug ALL
    </IfModule>
    BASH
  2. 설정 파일의 syntax 확인

    $ httpd -t
     
    Syntax ok
    CODE
  3. 재구동

    service httpd restart
    CODE

Cluster 

위와 동일하지만 WebLogicCluster 키워드로 was cluster 들의 IP(Ex: 192.168.1.100 ~192.168.1.102)를 모두 기술해야 함

<VirtualHost *:80>
    ServerName example.com
    <Location /weblogic>
      setHandler weblogic-handler
      PathTrim /weblogic
    </Location>

    <IfModule mod_weblogic.c>
      WebLogicCluster 192.168.1.100:8010, 192.168.1.101:8010, , 192.168.1.102:8010
      MatchExpression /*
    </IfModule>
    ErrorLog "logs/example.com-error.log"
    CustomLog "logs/example.com-access.log" common
</VirtualHost>
BASH

 

Ref