11 07 2014
Apache Httpd 2.2.x + JBoss EAP 6.x + Tomcat Connector 1.2.x Session Clustering
Contents
- 1 Apache HTTPD Server 설치
- 2 JBoss EAP 6.x 서버 설치 및 단일서버 포트오프셋 Session Clustering 구성
- 3 Apache Tomcat Connectors 다운로드 및 설치
- 4 mod_jk 설정
- 5 JBoss와 Apache HTTPD Server간의 역결을 위한 workers.proreties
- 6 웹서버 (Apache HTTPD Server)로 접속한 URL에 대해서 JBoss가 처리 할수 있도록 설정하는 (uriworkermap.properties)을 생성
- 7 Apache HTTPD Virtual Host 설정 아래의 명령을 실행하여 Apache HTTPD Server의 Virtual Host설정 파일을 편집합니다.
- 8 mod-jk.conf와 httpd-vhosts-jbtest.conf를 httpd.conf에 include한다.
Apache HTTPD Server 설치
JBoss EAP 6.x 서버 설치 및 단일서버 포트오프셋 Session Clustering 구성
Apache Tomcat Connectors 다운로드 및 설치
wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.40-src.tar.gz
tar xvzf tomcat-connectors-1.2.40-src.tar.gz
cd tomcat-connectors-1.2.40-src/native
./configure –with-apxs=/app/httpd/bin/apxs
make && make install
이렇게 하면 /app/httpd/modules밑에 mod_jk.so파일이 생성
설치완료
mod_jk 설정
vi /app/httpd/conf/extra/httpd-modjk.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# HTTPD Web Server and Apache Tomcat(ajp) Connector # the configuration of the server. # # Required modules: mod_jk (for the ajp handler), # Load Module jk_module <IfModule !mod_jk.c> LoadModule jk_module modules/mod_jk.so </IfModule> # jk_module Global configuration of the server <IfModule mod_jk.c> JkLogFile "|/app/httpd/bin/rotatelogs /app/httpd/logs/mod-jk.log.%Y%m%d 86400" JkLogLevel error JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories |
JkLogStampFormat “[%Y %a %b %d %H:%M:%S]”
JKRequestLogFormat “%w %R %V %T”
JkWorkersFile conf/extra/workers.properties
JkShmFile logs/mod-jk.shm
</IfModule>
JBoss와 Apache HTTPD Server간의 역결을 위한 workers.proreties
vi /app/httpd/conf/extra/workers.properties
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# HTTPD Web Server and Apache Tomcat(ajp) Connector # # Include workers.properties by conf/extra/httpd-modjk.conf worker.list=lbnode,jkstatus # configuration template worker.template.type=ajp13 worker.template.lbfactor=1 worker.template.socket_timeout=30 worker.template.socket_keepalive=true worker.template.recovery_options=7 worker.template.ping_mode=A worker.template.ping_timeout=10000 worker.template.fail_on_status=-404,-500,503,504 worker.template.connection_pool_size=25 worker.template.connection_pool_minsize=25 worker.template.connection_pool_timeout=30 #worker.template.max_packet_size=65536 # configuration node01 worker.node01.reference=worker.template worker.node01.host=127.0.0.1 worker.node01.port=8109 # configuration node02 worker.node02.reference=worker.template worker.node02.host=127.0.0.1 worker.node02.port=8209 # configuration loadbalancer worker.lbnode.type=lb worker.lbnode.retries=1 worker.lbnode.max_reply_timeouts=5000 worker.lbnode.method=Session worker.lbnode.sticky_session=True worker.lbnode.sticky_session_force=False worker.lbnode.balance_workers=node01,node02 worker.jkstatus.type=status |
웹서버 (Apache HTTPD Server)로 접속한 URL에 대해서 JBoss가 처리 할수 있도록 설정하는 (uriworkermap.properties)을 생성
vi /app/httpd/conf/extra/uriworkermap.properties
1 2 3 4 5 6 7 8 |
/jkstatus = jkstatus /*.jsp = lbnode /*.do = lbnode /clustering/* = lbnode !/*.js = lbnode |
Apache HTTPD Virtual Host 설정
아래의 명령을 실행하여 Apache HTTPD Server의 Virtual Host설정 파일을 편집합니다.
1 |
vi /app/httpd/conf/extra/httpd-vhosts-test.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
<VirtualHost *:80> ServerName www.nuriware.com ServerAlias nuriware.com DocumentRoot "/app/service/jbtest/deployments/ROOT.war" ServerAdmin admin@cacua.com Alias /data /app/service/jbtest/data SetEnvIf Request_URI "(\.gif|\.GIF|\.jpg|\.JPG|\.png|\.PNG|\.swf|\.ico|\.css|\.js)$" statics_log CustomLog "|/app/httpd/bin/rotatelogs /app/httpd/logs/hae_access.log.%Y%m%d 86400" common env=!statics_log CustomLog "|/app/httpd/bin/rotatelogs /app/httpd/logs/hae_statics.log.%Y%m%d 86400" common env=statics_log ErrorLog "|/app/httpd/bin/rotatelogs /app/httpd/logs/hae_error.log.%Y%m%d 86400" # SSLProxyEngine on # RequestHeader set Fron-End-Https "On" # ProxyPass /mngr https://localhost/mngr JkMount /*.do lbnode JkMount /*.jsp lbnode JkUnMount /statics lbnode JkMount /jkmanager jkstatus </VirtualHost> <Directory "/app/webapps/jbtest/deployments/ROOT.war"> Options FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory> <Directory "/app/webapps/jbtest/data"> Options FollowSymLinks MultiViews AllowOverride ALL Order allow,deny Allow from all </Directory> |
mod-jk.conf와 httpd-vhosts-jbtest.conf를 httpd.conf에 include한다.
vi /app/httpd/conf/httpd.conf
#Apache Tomcat connector mod-jk
Include conf/extra/httpd-modjk.conf
#Virtual hosts
Include conf/extra/httpd-vhosts-test.conf
아파치 PORT로 접속하면 8109,8209의 jboss를 실행되는것을 볼수 있다.
iis6 에서 SSL적용시 http 접속을 https 로 리다이렉트 설정하기 Java의 Out of Memory Error