Sunday, April 6, 2014

Using apache with mod_proxy module.

Steps :

1) setup connector in server.xml file of tomcat.

<Connector port="9090" maxHttpHeaderSize="8192"
           maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
           enableLookups="false" redirectPort="8443" acceptCount="100"
           connectionTimeout="20000" disableUploadTimeout="true"/>
 
path to locate file : apache-tomcat\conf\server.xml
 
 
2) put any war into webapps folder of tomcat
   eg. myApp.war
 
3) open httpd.conf file (path = C:\Apache24\conf\httpd.conf)from your apache24 folder and paste the following contents : 
 
<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass         /myapp  http://localhost:9090/myapp
ProxyPassReverse  /myapp  http://localhost:9090/myapp
 
 

4) start the tomcat. Make sure that you have closed the port 9090 by using nmap tool.
or 
just try accessing you app through:
localhost:9090/myapp
 
5) start apache tomcat.
 
6) Access your app by hitting:
   localhost/myapp

This will only work with http protocal. Wait for my next post to getting it working on port htpps as well.

Bye. Take Care!!

 

Saturday, April 5, 2014

Setting up Continous integration tool - Hudson

Follow the steps :

1) Download apache tomcat continer.

2) Setup all the environmental variables
i.e JAVA_HOME, ANT_HOME,MAVEN_HOME , HUDSON_HOME etc..

3) Download latest hudson war from
           http://hudson-ci.org/downloads/war/
 and place it into your tomcat's webapps folder.

path = apache-tomcat/webapps/hudson.war

4) Start your apache tomcat container  listening on some port eg.8080

5) visit the home page through url:

http://localhost:8080/hudson

6) On home page there will option to select multiples plugins.Select following basic required plugins and click install. It will take some time to complete:
7) Go to http://localhost/hudson/configure
here we can set system configuration.
i.e JAVA_HOME,MAVEN_HOME, etc
also set the other required things like Subversion,email settings,maven 3 settings etc

8) Setting up the job : 
a) Go to http://localhost/hudson/view/All/newJob and select first option i.e Build a free-style software job
b

b) set the svn settings to point to your project
c) set proper option to build project periodically.
eg.
* * * * * // to build per minute
*/5 * * * * to build  every 5 min
5,10,40 * * * * to build every 5,10,40 th minute of hour

d) set the maven goals for your job.
eg. clean test pmd:pmd checkstyle:checkstyle

e) setup various post build actions.


 f) click save to save the job.

g) please note that for email settings to work you need to set the JAVA_OPTS before starting the tomcat.you can set it in catalina.sh if using linux or in catalina.bat for windows.

export JAVA_OPTS=-Dmail.smtp.starttls.enable=true (for linux system)









Bye. keep Enjoying!!!