Skip to main content

Apache Tomcat Load Balance in windows

- apache tomcat Load Balance

1. apache installation
httpd-2.2.25-win32-x86-openssl-0.9.8y.msi
2. Module copy
tomcat-connectors-1.2.40-windows-i386-httpd-2.2.x/mod_jk.so =>
/apache/modules/mod_jk.so
3. tomcat copy
/apache-tomcat-7
/apache-tomcat-72

4. apache configuration modify
/apache/conf/httpd.conf

# apache-tomcat connector
<IfModule mod_proxy.c>
<IfModule mod_proxy_ajp.c>
Include "conf/extra/httpd-apj.conf"
</IfModule>
</IfModule>

LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogLevel info
JkLogFile logs/mod_jk.log
JkMount /*.html lb
JkMount /*.jsp lb
JkMount /*.ajax lb
JkMount /*.xpl lb
JkMount /j_spring_security_check lb

DocumentRoot "/wtpwebapps/testApp"

<Directory "/wtpwebapps/testApp">
   Options Indexes FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

<Location /jkmanager/>
JkMount jkstatus
 Order deny,allow
 Deny from all
Allow from 127.0.0.1
</Location>

/apache/conf/workers.properties

worker.list=lb

worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13

worker.worker2.port=8109
worker.worker2.host=localhost
worker.worker2.type=ajp13

worker.lb.type=lb
worker.lb.balance_workers=worker1,worker2

worker.list=jkstatus
worker.jkstatus.type=status


5. apache configuration test
/apache/bin>httpd -t
Syntax OK


6. tomcat configuration
1) server 1
<Connector port="7009" protocol="AJP/1.3" redirectPort="7443" />
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker2">

<Context docBase="/wtpwebapps/testApp" path="" reloadable="false"
sessionCookieName="SERVER2_JESSIONID"/>

2) server 2
<Connector port="7109" protocol="AJP/1.3" redirectPort="7143" />
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">

<Context docBase="/wtpwebapps/testApp" path="" reloadable="false"
sessionCookieName="SERVER1_JESSIONID"/>


Comments

Popular posts from this blog

Amazon RDS Blue/Green Deployments

In order to avoid some errors I experienced when proceeding as described in the official documentation, I describe what I did in order. 1) Modify parameters of source_database * error: Blue Green Deployments requires cluster parameter group has binlog enabled. RDS Parameter groups: source-params-group binlog_format => MIXED mysql> show global variables like 'binlog_format'; 2) Insert a row after rebooting the source database, to avoid this error. * error: Correct the replication errors and then switch over. Read Replica Replication Error - IOError: 1236, reason: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file' => To Fix: You need to change the data in the source database. INSERT INTO dummy_table ( `favorite_id` , `favorite_order` , `user_id` , `board_id` ) VALUES ('100001', '1', '11111', '11111'); 3) Modify the param...

Fluentd for mysql in AWS

(0) preparation ulimit -n If your console shows 1024, it is insufficient. Please add following lines to your /etc/security/limits.conf file and reboot your machine. root soft nofile 65536 root hard nofile 65536 (1) install Fluentd // “Ubuntu 12.04 LTS / Precise” curl -L http://toolbelt.treasuredata.com/sh/install-ubuntu-precise.sh | sh /etc/init.d/td-agent start/stop/restart/status // test curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test /etc/init.d/td-agent stop chown: changing ownership of `/var/run/td-agent/td-agent.pid': Operation not permitted chown: changing ownership of `/var/run/td-agent': Operation not permitted  * Stopping td-agent td-agent                                                                                   ...

Install CoreOs on linode without VM

Install CoreOs on linode without VM 1. Add a Linode 2. Create a new Disk   CoreOS 3. Rescue > Reboot into Rescue Mode 4. Remote Access   Launch Lish Console 5. make an install script cat <<'EOF1' > install.sh # add needed package sudo apt-get update sudo apt-get install -y curl wget whois sudo apt-get install -y ca-certificates #sudo apt-get install gawk -y # get discovery url discoveryUrl=`curl https://discovery.etcd.io/new` # write cloud-config.yml cat <<EOF2 > cloud-config.yml #cloud-config users:   - name: core     groups:       - sudo       - docker coreos:   etcd:     name: node01     discovery: $discoveryUrl hostname: node01 EOF2 # get the coreos installation script #wget https://raw.github.com/coreos/init/master/bin/coreos-install wget https://raw.githubusercontent.com/coreos/init/master/bin/coreos-install # run installation chmod 75...