中文字幕理论片,69视频免费在线观看,亚洲成人app,国产1级毛片,刘涛最大尺度戏视频,欧美亚洲美女视频,2021韩国美女仙女屋vip视频

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
Apache和tomcat負(fù)載均衡

Apachetomcat負(fù)載均衡配置mod_jk

1. 操作系統(tǒng)

RedHat Linux AS 4

2. 所需軟件

httpd-2.2.4.tar.gz

jakarta-tomcat-5.0.28.tar.gz 

tomcat-connectors-1.2.25-src.tar.gz

j2sdk-1_4_2_15-linux-i586-rpm.bin

備注:下載時(shí)將所需軟件包文件保存在/usr/local目錄下

3. 安裝步驟

   先安裝JDKTOMCAT;

A 安裝Apache

# cd /usr/local/

# tar xvfz httpd-2.2.4.tar.gz

# cd httpd-2.2.4

#./configure --prefix=/usr/local/apache --enable-module=so

# make

# make install

# cd /usr/local/apache/conf

# vi ./httpd.conf

Listen 80 修改為Listen :80

ServerName 修改為ServerName :80

# cd /usr/local/apache/bin/

# ./apachectl configtest

若顯示Syntax ok則表明安裝成功

#./apachectl start

啟動(dòng)apache服務(wù),訪問(wèn)本機(jī)80端口,查看端口是否正常

# ./apachectl stop

關(guān)閉服務(wù)

備注:prefix定義apache的安裝路徑

B 安裝JK

#cd /usr/local/

# tar xzvf tomcat-connectors-1.2.25-src.tar.gz

#cd tomcat-connectors-1.2.25-src /jk/native

#chmod 755 buildconf.sh

#./buildconf.sh

#./configure --with-apxs=/usr/local/apache/bin/apxs

#make

#make install

#cd /usr/local/tomcat-connectors-1.2.25-src/jk/native/apache-2.0/

#cp mod_jk.so /usr/local/apache/modules/

C 系統(tǒng)整合

#vi /usr/local/apache/conf/httpd.conf

在文件最末尾加上如下語(yǔ)句

# Load mod_jk
LoadModule jk_module modules/mod_jk.so
# Configure mod_jk
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkMount /* loadbalancer

 

增加workers.properties文件:


# vi /usr/local/apache/conf/workers.properties
#
# workers.properties
#
# In Unix, we use forward slashes:

ps=/

 

# list the workers by name
worker.list=tomcat1, tomcat2, loadbalancer

# ------------------------
# First tomcat server
# ------------------------

worker.tomcat1.port=8009
worker.tomcat1.host=127.0.0.1
worker.tomcat1.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat1.cachesize
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.tomcat1.lbfactor=100


# ------------------------
# Second tomcat server
# ------------------------

worker.tomcat2.port=8009
worker.tomcat2.host=192.168.1.34
worker.tomcat2.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat2.cachesize
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.tomcat2.lbfactor=100
# ------------------------
# Load Balancer worker
# ------------------------
# The loadbalancer (type lb) worker performs weighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=
tomcat1, tomcat2
#
# END workers.properties
#


#vi /usr/local/tomcat/conf/server.xml
<Connector
 port="8009" 
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"  
redirectPort="8443" protocol="AJP/1.3" />

120行左右加入如下語(yǔ)句
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1"></Engine>
若第二臺(tái)tomcat,將jvmRoute的修改為tomcat2

集群配置:

將兩中tomcat服務(wù)器的/usr/local/tomcat/conf/server.xml<Cluster>元素的注澤去掉。


至此,系統(tǒng)已經(jīng)整個(gè)完畢
啟動(dòng)apachetomcat服務(wù)
# /usr/local/apache/bin/apachectl start
#/usr/local/tomcat/bin/catalina.sh start

設(shè)置自動(dòng)啟動(dòng):
將如下內(nèi)容添加至/etc/rc.d/rc.local文件末尾,以便系統(tǒng)啟動(dòng)后開(kāi)啟apache,tomcat服務(wù)
/usr/local/tomcat/bin/catalina.sh start
/usr/local/apache/bin/apachectl start

 

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
csdn技術(shù)中心 redhat linux+apache+tomcat+mod_jk 負(fù)載均衡安裝說(shuō)明[來(lái)自xiaoaj@softroad.com.cn]
Apache+Tomcat集群之環(huán)境搭建
分布式部署Apache與Tomcat, 整合經(jīng)歷 (完全成功)
AIX 5.3環(huán)境下搭建ArcIMS92+Apache2.0.63+Tomcat5.5.2...
Linux+php+mysql安裝完整版本
CentOS Pub ---linux下apache和tomcat整合
更多類(lèi)似文章 >>
生活服務(wù)
熱點(diǎn)新聞
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服