apache + jboss + mod_jk调整
apache配置文件修改
mod_jk升级到1.2.25
jboss修改部分参数
lvs检测脚本修改
升级步骤:
1)首先关闭apache
2) 备份原来的mod_jk.so为mod_jk.so.1.2.14
cd /infowarelab/apache2/modules;mv mod_jk.so mod_jk.so.1.2.14
3) 取得最新的mod_jk源代码
cd /infowarelab/src
wget -c
tar zxfv tomcat-connectors-1.2.25-src.tar.gz
cd tomcat-connectors-1.2.25-src/native/
./configure --with-apxs=/infowarelab/apache2/bin/apxs --with-java-home=/infowarelab/jdk && make && make install
4) 修改mod_jk有关的配置文件
备份原来的配置文件
cd /infowarelab/apache2/conf
cp mod_jk.conf mod_jk.conf.1.2.14;cp workers.properties workers.properties.1.2.14;cp uriworkermap.properties uriworkermap.properties.1.2.14
创建新的 mod_jk.conf配置文件
cat > mod_jk.conf <
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile "|/usr/local/sbin/cronolog /infowarelab/apache2/logs/mod_jk-%Y-%m-%d.log"
#
# Set the jk log level [debug/info/warn/error/trace]
#
JkLogLevel warn
#
# Select the log format
#
JkLogStampFormat "[%H:%M:%S]"
#
# JkShmFile location
#
JkShmFile "/var/run/mod_jk-status"
#
# JkShmSize
#
JkShmSize 128Kb
#
# JkOptions indicate to send SSL KEY SIZE,
#
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
#
# JkRequestLogFormat set the request format
#
#JkRequestLogFormat "%w %V %T %m %U%q %s"
JkRequestLogFormat " %w %v %T"
#
# add file type matched through mod_jk
#
JkMountFile conf/uriworkermap.properties
EOF
创建新的 workers.properties 配置文件
cat > workers.properties <
worker.list=jboss
worker.jboss.port=8009
worker.jboss.host=127.0.0.1
worker.jboss.type=ajp13
worker.jboss.socket_keepalive=0
worker.jboss.socket_buffer=8192
worker.jboss.connection_pool_size=64
worker.jboss.connection_pool_timeout=600
worker.jboss.socket_timeout=60
worker.jboss.retries=2
EOF
修改uriworkermap.propertiese配置文件
注意:(jboss是ajp13 worker的名称)
增加一行:(确保lvs穿透apache)
/iwl/.lvs.html=jboss
然后一定要修改所有其他的worker name 为jboss(例如:lb)
到此mod_jk配置文件修改完毕
5)修改apache配置文件
修改/infowarelab/apache2/conf/extra/httpd-mpm.conf,将
修改为如下:
StartServers 16
ServerLimit 75
ThreadLimit 64
MaxClients 1024
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 64
MaxRequestsPerChild 10000
到此为止,apache,mod_jk修改完毕
6)修改jboss部分配置文件
修改/infowarelab/jboss/server/default/conf/jboss-service.xml中的配置项
10
为
300
修改/infowarelab/jboss/server/default/deploy/jbossweb-tomcat55.sar/server.xml中ajp connector配置项
如下:
port="8009"
address="${jboss.bind.address}"
maxThreads="300"
minSpareThreads="25"
maxSpareThreads="75"
emptySessionPath="true"
enableLookups="false"
backlog="64"
URIEncoding="utf-8"
connectionTimeout="600000"
tcpNoDelay="true"
disableUploadTimeout="true"
protocol="AJP/1.3"/>
创建 iwl.war 应用程序
cd /infowarelab/jboss/server/default/deploy
cp -a jbossweb-tomcat55.sar/ROOT.war iwl.war
创建 .lvs.html 检测文件
cd iwl.war;echo OK > .lvs.html
修改完毕
apache增加静态文件压缩模块
/infowarelab/apache2/bin/apxs -i -a -c /infowarelab/src/httpd-2.2.3/modules/filters/mod_deflate.c
/infowarelab/apache2/bin/apxs -i -a -c /infowarelab/src/httpd-2.2.3/modules/metadata/mod_headers.c
#add conf in httpd.conf
DeflateCompressionLevel 7
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/x-httpd-php AddOutputFilter DEFLATE css js
阅读(3793) | 评论(0) | 转发(0) |