|
安装Apache
先把 Apache 2.0.59 下载到 /home/用户目录/Devtools 下,然后加压缩到/bea/目录
shell> cd /bea/
shell> tar -zxvf Apache_2.0.59_for_Linux.tar.gz
然后进入httpd目录新建一个编译脚本,方便维护和以后升级。每次执行下面的setup.sh就可以安装了(前提是安装libxml2库、zlib库)
./configure --prefix=/bea/apache --enable-so --enable-rewrite --enable-dav --enable-info --enable-cgid --enable-mime-magic --enable-alias --enable-access --enable-deflate --enable-proxy --enable-proxy-http --enable-forward
make
make install
这样就可以把制定的模块静态编译到Apache里,而且也支持动态加载模块。
把Apache当作服务启动
shell> cp /opt/apache/bin/apachectl /etc/rc.d/init.d/httpd
shell> chmod 700 /etc/rc.d/init.d/httpd
shell> chkconfig –add httpd
shell> chkconfig –level 345 httpd on
shell> service httpd start
shell> netstat -atln
配置apache作为weblogic的前端服务器
准备:
操作系统:Red Hat 3.4.6-8
weblogic: 9.1.0.0
apache: 2.0.59
Step1:安装weblogic,这个就不用多说了吧。
安装上之后,因为回头要测试集成配置是否成功,最好先建议一个domain,然后deploy一个web应用程序。
我的weblogic的第一个domain是testdomain,然后端口号是7001,deploy了一个叫做portal的war.
可以通过http://localhost:7001/portal/index.jsp访问,显示“HelloWOrld str is TEST123”的字样。
Step2:安装apache。如第六章。
编译:编译的时候切记要加上--enable-so这个参数,否则就不能成功的跟weblogic配置在一起了。
Step3:configure apache
a.编辑/bea/apache/conf/httpd.conf
在Listen 80下面一行,加上下面的文字:
LoadModule weblogic_module modules/mod_wl_20.so
<IfModule mod_weblogic.c>
Include conf/Weblogic.conf
</IfModule>
保存文件。
b.cp /bea/weblogic91/server/plugin/linux/i686/mod_wl_20.so /bea/apache/modules/
c.在/bea/apache/conf下面建立一个叫做Weblogic.conf的文件,内容如下:
#####Weblogic.conf file
WebLogicHost localhost
WebLogicPort 7001
MatchExpression *.jsp
MatchExpression /portal/*
MatchExpression /console/*
# MatchExpression *.html
#MatchExpression *.jpg
#MatchExpression *.gif
#MatchExpression *.css
#MatchExpression *.do
WLLogFile /tmp/wlproxy.log
保存文件。
d.重新启动apache.
Step4:测试
http://localhost:80/portal/index.jsp
Got it. |
|
|
|
|
|
|