Showing posts with label configuration. Show all posts
Showing posts with label configuration. Show all posts

Wednesday, September 5, 2012

Spring REST web service Test

We can test the Spring REST web service by following :

1. By java Junit class.
2. By SoapUI.
3. By Firefox browser plugin REST CLIENT.
4. By Chrome browser plugin POST MAN.


1. By java Junit class :
We can write the java junit class to test REST service. its simple test class in ur maven web application.



2. By SoapUI : We can test by using Open Source SoapUI tool, it very simple configure and test the web services.
http://www.soapui.org/REST-Testing/getting-started.html

3. By Firefox browser plugin REST CLIENT : we can use REST CLIENT plugin
https://addons.mozilla.org/en-US/firefox/addon/restclient/

4. By Chrome browser plugin POST MAN: we can use POST MAN plugin
https://chrome.google.com/webstore/detail/fdmmgilgnpjigdojojpjoooidkmcomcm

Saturday, March 13, 2010

Clustering or LoadBalancer configuration with apache web server

install Apache HTTP Server2.2.11 web server.
Once the installation starts follow the steps as shown in following figures.






Configuration of Web server

          Configuration at Apache Http Server (Web Server)

Apache JK_MOD (Tomcat Connector).
In order to apache web server able to communicate with the Application, we need to configure Apache JK_MOD, for this purpose we need to enable the Apache module “mod_jk.so”.

Download the mod_jk_version_number.so rename it to mod_jk.so and place it under “ApacheInstallation”/modules

 

Edit apache web server configuration file “ApacheInstallation”/httpd.conf and add the below parameters:

# Include mod_jk configuration file
   Include conf/mod_jk.conf

Create a file under “ApacheInstallation”/httpd as mod_jk.conf and add the below properties into it
             
mod_jk.conf file

LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel debug
JkLogStampFormat  "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /custcare/* loadbalancer
JkShmFile logs/jk.shm
JkMount status
Order deny,allow
Deny from all
Allow from all

Create a worker.properties file under “ApacheInstallation”/httpd and add the following parameters

# Define list of workers that will be used
# for mapping requests
  worker.list=loadbalancer

# Define Node1
# modify the host as your host IP or DNS name.
  worker.node1.port=8009
  worker.node1.host=192.168.2.107
  worker.node1.type=ajp13
  worker.node1.lbfactor=1
# worker.node1.local_worker=1 (1)
# worker.node1.cachesize=10

# Define Node2
# modify the host as your host IP or DNS name.
  worker.node2.port=8009
  worker.node2.host=192.168.2.55
  worker.node2.type=ajp13
  worker.node2.lbfactor=1
# worker.node2.local_worker=1 (1)
# worker.node2.cachesize=10
# Load-balancing behavior
  worker.loadbalancer.type=lb
  worker.loadbalancer.balance_workers=node1,node2
  worker.loadbalancer.sticky_session=1
# worker.loadbalancer.local_worker_only=1
# worker.list=loadbalancer

 

Configuration on Customer care Application server Node’s  

                                       

Copy the “JbossInstallation”/server/all/deploy/tc5-cluster.sar folder into “jbossinstallation”/server/custcare/deploy/
  Copy the “JbossInstallation”/server/all/lib/jboss-cache.jar and jgroups.jar into “jbossinstallation”/server/custcare/lib   under the “jbossinstallation”/server/custcare/jbossweb-tomcat55.sar/server.xml

8009" address="${jboss.bind.address}"
emptySessionPath="true" enableLookups="false" redirectPort="8443"
protocol="AJP/1.3"/>

                 jvmRoute="node1">

Note : node1 is the system IP mapped to node in the worker.properties in the “ApacheInstallation”/httpd  

  
  under the “jbossinstallation”/server/custcare/jbossweb-tomcat55.sar/META-INF/jboss-service.xml

true