六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 24|回复: 0

centos上搭建apache

[复制链接]

升级  25.33%

80

主题

80

主题

80

主题

举人

Rank: 3Rank: 3

积分
276
 楼主| 发表于 2013-1-31 10:46:40 | 显示全部楼层 |阅读模式
1. 安装httpd
yum install httpd-2.2.3rpm -q httpd

2. 增加module:mod_jk.so
wget http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.23/mod_jk-1.2.23-apache-2.2.x-linux-x86_64.somv mod_jk-1.2.23-apache-2.2.x-linux-x86_64.so mod_jk.somv mod_jk.so /usr/lib64/httpd/modules/mod_jk.so

3. 修改httpd.conf
sed -i '$a include /etc/httpd/conf/mod_jk.conf' /etc/httpd/conf/httpd.conf

4. 增加mod_jk.conf
# Load mod_jk moduleLoadModule jk_module /usr/lib64/httpd/modules/mod_jk.so# Where to find workers.propertiesJkWorkersFile /etc/httpd/conf/workers.properties# Where to put jk logsJkLogFile logs/mod_jk.log# Set the jk log level [debug/error/info]JkLogLevel info# Select the log formatJkLogStampFormat "[%a %b %d %H:%M:%S %Y] "# JkOptions indicate to send SSL KEY SIZE.JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories# JkRequestLogFormat set the request formatJkRequestLogFormat "%w %V %T"# Send servlet for context /examples to worker named ajp13# JkMount /servlet/* ajp13# Send JSPs for context /examples to worker named ajp13JkMount /searcher/* searcherJkMount /jkmanager/* jkstatus

5. 增加workers.properties
###========worker.list========worker.list=searcher,jkstatus###========searcher========worker.searcher.type=lbworker.searcher.method=Bworker.searcher.balance_workers=searcher1,searcher2,searcher3# *..* sticky_session=1.......sticky_session_force=1, .........worker..worker.searcher.sticky_session=1worker.searcher.sticky_session_force=0worker.searcher1.port=8009worker.searcher1.host=192.168.1.231worker.searcher1.type=ajp13worker.searcher1.lbfactor=1worker.searcher2.port=8009worker.searcher2.host=192.168.1.232worker.searcher2.type=ajp13worker.searcher2.lbfactor=1worker.searcher3.port=8009worker.searcher3.host=192.168.1.233worker.searcher3.type=ajp13worker.searcher3.lbfactor=1###=======jkstatus==========worker.jkstatus.type=status<Location /jkmanager/>    JkMount jkstatus    Order deny,allow    Deny from all    Allow from all</Location>

6. 启动httpd
/usr/sbin/httpd -k start

7. 通过http://$host/jkmanager查看apache状态
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表