« December 2005 | Main | May 2006 »

January 2006 Archives

January 19, 2006

Apache2 integrating Tomcat 5.5 on windows

I have been trying to do this off and on for over a year and a half and every time i run into problems and I get pissed and quit. I have found hundreds of pages that all say different ways of how to solve the problem of integrating tomcat 5.5 with apache2. Non of them worked for me, but after combining tips from various install guides I can show you what finally worked for me. After wasting over all the time hours and hours... here is all that I did small changes to the apache configure file and small ones to tomcats... restart both of there servers and WHOOPIE it just works. Apache2 with Tomcat 5.5 on a windows server.

httpdconf changes:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so


ServerName special.myname.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"


ProxyRequests On
ProxyPass /cool http://66.***.***.**3:8082/your/webapp/rootdir/
#
# these are comments on the dir
#C:\Program Files\Apache\Tomcat 5.5\webapps\you\webapp\rootdir\
# if anyone was confused to how that would map to windows tomcat stuff
#
ProxyPass /*.jsp http://66.***.***.**3:8082

tomcat's server.xml:

maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" acceptCount="100" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />


thats it... you might have to change some of your jsps for how they find local directories and get all the lookups for the local directories to match your mapping, but you got it... it should all work now. Congradulations... if that didnt work for you here are some sites I was looking at for help:

Apache proxy forwarding

Apache 2 tomcat 5.5

best of luck post comments here and i can try to help you if they are problems i have run into before.

Junit testing server states

Alot of Junit docs and faq tells you that have bad design if your trying to extend test suite so that there is only one setUp() and testDown() for a whole sweet of tests, but that just isnt true when your trying to tests proper order of state changes each transaction should change the state of the server dpending on its current state, if the server is started up new for each test your only testing the start up state... my single unit tests have dependencies on previous tests that has cuased the server to be in its current state... So no where gives good documentation on how to do this the faq is un usefully short showing how to extend testSuite but not how to use it... so here is the best page for how to actually use it just ignore hte Turbine2 stuff:

16. Q: How can I setup Turbine once for my JUnit Test cases?

And remember that Junit executes your tests in order alphabetically and numerically after the intial keyword test.

ie

TestA will run before TestB so if you running tests in order for state make sure that you have your tests named appropriately to be sure they will run in the expected order.

hope this helps someone running into problems running Juint with a single setUp across a suite of tests.

January 30, 2006

Ant options

if your running out of Java Heap space memory while running ant you probably just need to increase the memory size for ant when it is running to do this you set the enviroment variable ANT_OPTS.

ANT_OPTS=-Xmx128M

in windows you right click my computer go to properties, and then click advanced then set new enviroment variable name ANT_OPTS value -Xmx128M. If your running cygwin you must close current instances and reopen them to get the new settings to take effect, after opening up cygwin again try >echo $ANT_OPTS which should output your setting. If you still receive the error you can go higher with your memory. I have never had to go higher than 256.

Web 2.0 craziness

View Dan Mayer's profile on LinkedIn


I Power Seekler
I Power Seekler

www.flickr.com
This is a Flickr badge showing public photos and videos from mayer_dan. Make your own badge here.

Creative Commons License
This weblog is licensed under a Creative Commons License.