Posts

Showing posts from January, 2013

How to setup JBoss Apache mod_jk

This note provides typical setup steps for Jboss application server. Initial setup Install Java Install apache-ant (Just need to extract the zip) Configure environment variable For example /root/.bash_profile ANT_HOME=/opt/ant PATH=/opt/java/bin:$ANT_HOME/bin:$PATH:$HOME/bin:./ JAVA_HOME=/opt/java export JAVA_HOME export PATH export CLASSPATH=/usr/java/jdk/lib/tools.jar:/usr/java/jdk/jre/lib/rt.jar:./ Install jboss GA version http://sourceforge.net/projects/jboss   Unzip it at /opt directory Configure environment variable /root/.bash_profile JBOSS_HOME=/opt/jboss export JBOSS_HOME Write init script to start Startup nohup /opt/jboss/bin/run.sh -b 0.0.0.0 & Shutdown opt/jboss/bin/shutdown -S Install mod_jk for apache proxying http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux Copy mod_jk.so to /etc/httpd/modules Edit httpd.config for mod_jk vi /etc/httpd/conf/httpd.conf Include conf/mod_jk.conf Create /etc/httpd/conf/mod_jk.c...

Web load balancer with HAproxy

This note provides steps for up and running haproxy loadbalancer for http service. Install haproxy rpm yum install haproxy Edit haproxy.cfg vi /etc/haproxy/haproxy.cfg global maxconn 100000 user haproxy group haproxy defaults #log global mode http # option httplog # option dontlognull retries 3 option redispatch maxconn 100000 contimeout 5000 clitimeout 50000 srvtimeout 50000 VIP address. Do not add config at /etc/sysctl.conf listen webfarm 192.168.1.3:80 It can be tcp or http mode http # stats enable # stats auth someuser:somepassword balance roundrobin # allow to track source ip option forwardfor option httpchk HEAD /linkcheck.html HTTP/1.0 server webA 192.168.1.1:80 cookie A check server webB 192.168.1.2:80 cookie B check Edit system parameter vi /etc/sysctl.conf net.ipv4.ip_nonlocal_bind = 1