分类: LINUX
2009-08-05 16:15:39
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文件
tar zxvf httpd-2.2.11.tar.gz
|
3、修改httpd.conf文件
Listen80此端口可以根据实际情况进行修改,此我没有修改我使用的是80
vi /usr/local/apache2/conf/httpd.conf
User apache Group apache |
5、将下载的mod_jk-1.2.28-httpd-2.2.X.so文件修改并拷贝
mv mod_jk-1.2.28-httpd-2.2.X.so mode_jk (进行改名) cp mode_jk /usr/local/apache2/modules (拷贝到这个modules下) chmod +x /usr/local/apache2/modules/mode_jk
进入到/usr/local/apache2/conf目录下,修改httpd.conf文件
Include conf/mod_jk.conf |
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule status_module modules/mod_status.so |
Order deny,allow allow from all ProxyPass / balancer://proxy/ stickysession=JSESSIONID nofailover=On lbmethod=byrequests ProxyPassReverse / balancer://proxy/ BalancerMember ajp://192.168.133.133:8009/ loadfactor=50 route=note1 BalancerMember ajp://192.168.133.233:8009/ loadfactor=50 route=note2 |
#Load mod_jk module # Specify the filename of the mod_jk lib LoadModule jk_module modules/mod_jk.so # Where to find workers.properties JkWorkersFile conf/workers.properties # Where to put jk logs JkLogFile logs/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" # JkOptions indicates to send SSK KEY SIZE JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkRequestLogFormat JkRequestLogFormat "%w %V %T" # 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 |
# 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
# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
#1表示使用粘着0表示非粘着
worker.loadbalancer.sticky_session=0
#worker.list=loadbalancer
# Status worker for managing load balancer
worker.status.type=status |
/jmx-console=loadbalancer /jmx-console/*=loadbalancer /web-console=loadbalancer /web-console/*=loadbalancer |
JBOSS_HOME/server/all/deploy/jboss-web.deployer/server.xml
给主人留下些什么吧!~~
|