系统环境:
OS:linux AS4 2.6.9-78.EL
APP: apache httpd-2.2.11.tar.gz
Jboss 4.2.3
需要mod_jk-1.2.28-httpd-2.2.X.so文件
一、Apache的安装配置
1、解压apache包
tar zxvf httpd-2.2.11.tar.gz
2、编译apache
./configure –prefix=/usr/local/apache2 –enable-module=so –enable-module=setenvif –enable-module=rewrite –enable-rewrite=shared –enable-proxy=shared –with-mpm=prefork –enable-so –enable-auth-anon –enable-file-cache=shared –enable-cache=shared –enable-disk-cache=shared –enable-mem-cache=shared
make clean
make make
install
3、修改httpd.conf文件
vi /usr/local/apache2/conf/httpd.confListen80此端口可以根据实际情况进行修改,此我没有修改我使用的是80
User daemon和Group daemon改为
User apache
Group apache
删除ServerName的#(注释)此处注意你如何修改了端口,最好加上端口。
# Mount your applications
JkMount /*.* loadbalancer
# You can use external file for mount points.
# It will be checked for updates each 60 seconds.
# The format of the file is: /url=worker
# /examples/*=loadbalancer
JkMountFile conf/uriworkermap.properties
# Add shared memory.
# This directive is present with 1.2.10 and
# later versions of mod_jk, and is needed for
# for load balancing to work properly
JkShmFile logs/jk.shm
# Add jkstatus for managing runtime data
JkMount status
Order deny,allow
Deny from all
Allow from 127.0.0.1
7、新建workers.properties文件内容如下
# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status
# worker.list=loadbalancer,node1,node2
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host=192.168.133.133
worker.node1.type=ajp13
worker.node1.lbfactor=1
worker.node1.cachesize=100
# Define Node2
# modify the host as your host IP or DNS name.
worker.node2.port=8009
worker.node2.host= 192.168.133.233
worker.node2.type=ajp13
worker.node2.lbfactor=1
worker.node2.cachesize=100