[Apache] httpd的weblogic分发

测试环境可用apache httpd来模拟F5设备的负载

1.安装
解压tar -zxvf httpd-2.2.6.tar.gz,完成之后,会在当前目录出现一个httpd-2.2.6目录,
然后顺序执行如下命令

mv httpd-2.2.6 apache 
cd apache

设置安装参数,命令如下:

./configure --prefix=/home/lw/apache --enable-so --enable-mods-shared=all --enable-proxy=shared --enable-rewrite=shared --with-mpm=worker

2.参数说明
/home/lw/apache/conf/httpd.conf

ServerType standlone/inetd 服务器的运行方式
Port 80 或者Listen 80 在standlone方式下监听的端口号
User nobody 进程运行的属主
Group nobody 进程运行的属组
ServerAdmin?admin@localhost?管理员信箱
ServerRoot “/home/httpd/” 服务器文件位置
ServerName httpserver服务器名称
Timeout 300设置服务器和客户端的连接超时时间
MaxClient 300允许同时连接的客户数
ProxyRequests on允许充当proxy
DocumentRoot “/home/httpd/html”提供服务器文档服务的根目录
UserDir public_html服务器上用户自己主页所在目录
DirectoryIndex index.html目录索引文件
AccessFileName .htaccess在每个目录中包含访问控制信息的文件名
Alias /icons/ “/home/user/icons/”为不在DocumentRoot之下的文档建立别名

3.配置面向weblogic分发
step1: 将mod_wl_22.so放到 apache/modules目录下,用于转weblogic。这个so要另外下载
step2: 启动Apache
配置/home/mw/weblogic/apache/conf/httpd.conf
1>Listen
2>ServerAdmin
3>ServerName

#Listen 12.34.56.78:80
 Listen 8081</pre>
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin ebda@ebda.com

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName localhost:80
<pre>

step3: 做Apache分发
在/home/mw/weblogic/apache/conf/httpd.conf末尾添加

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule weblogic_module modules/mod_wl_22.so

<Location /ebda_report>
 SetHandler weblogic-handler
 WebLogicCluster 128.192.156.117:8201,128.192.156.117:8202
</Location>
<IfModule mod_weblogic.c>
 WebLogicHost 128.192.156.117
 WebLogicPort 8201
 MatchExpression /ebda_report/*
</IfModule>
<IfModule mod_weblogic.c>
 WebLogicHost 128.192.156.117
 WebLogicPort 8202
 MatchExpression /ebda_report/*
</IfModule>

step4: 启动/停止 Apache

..bin
./httpd -k start
./httpd -k stop
分类上一篇:     分类下一篇:

Leave a Reply