二.Weblogic的部署
Apache与weblogic进行整合的时候.
1.Apache可以充当前端控制器的作用(配置集群,不同的服务发送到不同的weblogic服务器);
2.还可以缓解weblogic服务器的压力(Apache HTTP Server可以解析静态的页面元素:
CSS,JS,图片,HTML,而把动态的页面:jsp,DO连接交给weblogic进行处理)
进入weblogic管理控制台,部署testPic应用:
这里的index.jsp为动态的,在页面中JavaEye的图片可以通过配置Apache httpd.conf用Apache解析.
如下图weblogic部署:
见图2
三. 配置Apache
1. 到/usr/local/apache/bin目录下面,然后执行 ./httpd –l
如果能看到mod_so.c表明当前的Apache HTTP Server是动态加载的模式,
可以和WebLogic进行整合,否则要重新编译Aapache
2. 手工将weblogic安装目录下bea/weblogic81/server/lib/linux/i686/mod_wl_20.so
拷贝到/usr/local/apache/modules目录下;
如果是自己的PC机选择MOD_WL为:bea/weblogic81/server/lib/linux/i686/mod_wl_20.so,
注意:在不同CPU上,不同的Apache版本的这个文件不同;
3. 配置Apache httpd.conf文件;
末尾添加如下内容:
##################################################################
################ GREATWQS install ##############################
##################################################################
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
#我监听的是2010端口,如果你这里选择80端口,后面的<VirtualHost *:2010> 2010也要换到80端口
Listen 2010
ServerName localhost:80
# LoadModule rewrite_module modules/mod_rewrite.so
# GREATWQS UPDATE
# Load weblogic config file and module
LoadModule weblogic_module modules/mod_wl_20.so
# <IfModule mod_weblogic.c>
# Include conf/Weblogic.conf
# </IfModule>
# those description is working!
<VirtualHost *:2010>
# 这里是配置静态文件,因为这里的简单测试index.jsp中含有
# 静态文件JavaEye的图片,这里要有Apache解析.见下图三静态图片文件的存放!
DocumentRoot "/opt/apache/apache_wl"
ServerPath /
DirectoryIndex index.jsp index.html
Options -FollowSymLinks +SymLinksIfOwnerMatch
# AllowOverride None
<Location>
<IfModule mod_weblogic.c>
# Debug ON
# DebugConfigInfo On
# WLLogFile /tmp/wlproxy.log
# 这里应该是集群中的某个地址,这里采用本地.
WebLogicHost localhost
WebLogicPort 7001
MatchExpression *.jsp
MatchExpression *.do
MatchExpression *.dos
# MatchExpression *.css
# MatchExpression *.html
# MatchExpression *.js
# MatchExpression *.jpg
# MatchExpression *.gif
DynamicServerList OFF
KeepAliveEnabled ON
KeepAliveSecs 5
</IfModule>
</Location>
</VirtualHost>
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/opt/apache/apache_wl"
##################################################################
############### end ##########################################
##################################################################