1、apache+weblogic集群部署手册1Apache+weblogic集群部署手册此文档适合linux下所有平台,具体版本请参照oracle官方文档部署撰写:曹鹏飞2011-7-8目录一、apache和weblogic集群构建的概念 31.1、概述 31.2、apache代理+weblogic整合方式部署的两种方式 31.3、两种方式的区别 3二、apache代理服务器安装步骤 32.1、部署环境 32.2、安装步骤 42.3、配置代理转发服务器 6三、weblogic安装步骤 73.1、部署环境 73.2、安装步骤 83.3、domain的配置 143.4、WEB应用的配置启用 22四、
2、集群系统优化方案 25五、安装过程中常遇问题及解决方法 25一、apache和weblogic集群构建的概念1.1、概述 一般来说一个Web应用都分为动态内容(jsp,servlet, CGI)和静态内容(图片,文档,HTML)两部分内容。而在很多地方,我们都没有把动态和静态内容进行分离,来提高应用的整体性能。因此我们提出以下方案来满足我们的需求。1.2、apache代理+weblogic整合方式部署的两种方式方式一:Apache只做代理服务器,整个web应用都部署在Weblogic中。方式二:不仅让Apache做前端代理服务器,而且将静态页面部署在Apache里,动态页面部署在Weblogi
3、c里。1.3、两种方式的区别方式一是将所有请求都由Apache转发到指定的Weblogic服务器。方式二实现了动态页面和静态页面分开,当客户端请求静态页面时,直接使用Apache处理请求并返回给客户端,而客户端请求动态页面时,由Apache转发到指定的Weblogic服务器。二、apache代理服务器安装步骤2.1、部署环境2.1.1、系统版本号rootcsii # uname -aLinux csii 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linuxresolv.confrootcsii #
4、 more /etc/redhat-release Red Hat Enterprise Linux Server release 5.4 (Tikanga)2.1.2、字符集时间配置设定系统语言环境:/etc/sysconfig/i18n为zh_CN.GBKvi /etc/sysconfig/i18n LANG=zh_CN.GBKSUPPORTED=zh_CN.GBK:zh:zh_CN.GB2312:zh:zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:sSYSFONT=latarcyrheb-sun16检查服务器的时区与时间是否设定正确:正确时区应设定为:Ch
5、ina standard Time(CST) 中国标准时间。执行cat /etc/sysconfig/clock看是否有以下3行显示,如果不是的话则需要做下面的修改步骤(或者执行timeconfig)ZONE=Asia/ShanghaiUTC=falseARC=false修改步骤:#mv /etc/localtime /etc/localtime.bak# I -sf /I/share/I/Asia/Ietc/localtime将时区文件(/etc/sysconfig/clock)更改为以下内容:ZONE=Asia/ShanghaiUTC=falseARC=false2.1.3、源码包选择ht
6、tpd-2.2.8.tar.gz2.2、安装步骤#tar zxvf httpd-2.2.8.tar.gz#cd /software/httpd-2.2.8# ./configure -prefix=/usr/local/apache2 -enable-so -enable-mods-shared=proxy proxy_http proxy_connect# make & make install# /usr/local/apache2/bin/apachectl start/stop# cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/
7、httpd# ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc5.d/S85httpd编辑apache启动停止脚本rootcsii httpd-2.2.8# vi /etc/rc.d/init.d/httpd#!/bin/bash#Program:# httpd#History:# Startup script for the Apache2.0.X Web Server# chkconfig: 345 85 15# description: Apache is a World Wide Web server. It is used to serve # HT
8、ML files and CGI.# Source function library. /etc/rc.d/init.d/functionsif -f /etc/sysconfig/httpd ; then . /etc/sysconfig/httpdfiINITLOG_ARGS=apachectl=/usr/local/apache2/bin/apachectlhttpd=$HTTPD-/usr/local/apache2/bin/httpdprog=httpdstart() ps -ef | grep $prog | grep -v grep | grep -v start /dev/nu
9、ll if $? -eq 1 ; then echo -n $Starting $prog: daemon $httpd $OPTIONS ret=$? echo $ret -eq 0 & touch /var/lock/subsys/httpd return 0 else echo httpd running return 0 fistop() status httpd /dev/null &1 ret_status=$? if $ret_status -eq 2 ; then rm -f /var/lock/subsys/httpd /var/run/httpd.pid echo http
10、d stopped return 0 elif $ret_status -eq 3 ; then echo httpd stopped return 0 fi echo -n $Stopping $prog: killproc $httpd ret=$? echo $ret -eq 0 & rm -f /var/lock/subsys/httpd /var/run/httpd.pid return 0case $1 in start) start ; stop) stop ; status) status httpd ; restart) stop sleep 2 start ; *) ech
11、o $Usage: $prog start|stop|restart|status exit 1esac到此结束编辑退出;# chkconfig -level 345 httpd# chkconfig -add httpd出现以下情况表示安装成功rootcsii httpd-2.2.8# service httpd restart停止 httpd: 确定启动 httpd: 确定2.3、配置代理转发服务器 将Linux 32位的weblogic转发模块mod_wl_22.so,cp mod_wl_22_for_linux_32.so /usr/local/apache2/modules/mod_
12、wl_22.so (注意给新模块加执行权限)目录下,编辑httpd.conf文件,加入如下行:例1LoadModule weblogic_module modules/mod_wl_22.soWebLogicHost 10.1.1.8WebLogicPort 8001MatchExpression /csii1WebLogicHost 10.1.1.8WebLogicPort 8002MatchExpression /csii2WebLogicHost 10.1.1.8WebLogicPort 8003MatchExpression /csii3例2LoadModule weblogic_mo
13、dule modules/mod_wl_22.soSetHandler weblogic-handlerWebLogicHost 38.19.7.17WebLogicPort 8001Sethandler weblogic-handlerWebLogicHost 38.19.7.17WebLogicport 8003SetHandler weblogic-handlerWebLogicHost 38.19.7.17WebLogicPort 8005测试:(1) 启动Apache,命令如下:#service httpd start(2) 在浏览器中分别输入:http:/10.1.1.8/csii
14、1http:/10.1.1.8/csii2http:/10.1.1.8/csii3(3) 页面显示:It works!(这里是装好weblogic情况下,否则没有那些端口服务当然访问不了)(4) 安装成功。三、weblogic安装步骤3.1、部署环境3.1.1、系统版本号rootcsii # uname -aLinux csii 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linuxresolv.confrootcsii # more /etc/redhat-release Red Hat Enterprise Linux Server release 5.4 (Tikanga)3.1.2、部署安装包jdk-6u24-linux-i586.bi
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1