如要轉(zhuǎn)發(fā)請(qǐng)注明lzj65166.cublog.cn
最近一直工作很忙,沒(méi)有時(shí)間來(lái)寫(xiě)這些東東,今天有點(diǎn)時(shí)間就把這個(gè)整理了一點(diǎn)文章,其實(shí)網(wǎng)上有很多了,為什么還要寫(xiě)呢,一個(gè)是為了方便自己查閱,一個(gè)方便初級(jí)者們的安裝吧,看到網(wǎng)上的都是講了一些大體的地方,不是很細(xì),希望我的文章能幫助大家吧。
去哪里下載程序,我就不說(shuō)了,大家自己去官方找吧。
系統(tǒng)環(huán)境:
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此端口可以根據(jù)實(shí)際情況進(jìn)行修改,此我沒(méi)有修改我使用的是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文件內(nèi)容如下
# 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