JSP Quick-Start Guide for Windows

This is an article discussion thread for discussing the SitePoint article, “JSP Quick-Start Guide for Windows

When trying to set the DocumentRoot in httpd.conf equal to a folder with an index.jsp file, Apache would just display the souce code, or ask me to download it. So i needed to make Tomcat execute the jsp pages. An easy way is to add these lines to the httpd.conf file…

<Location “/*.jsp”>
JkUriSet worker ajp13:localhost:8009
</Location>

<Location “/tomcat-docs”>
JkUriSet worker ajp13:localhost:8009
</Location>

I found this on the Tomcat 4.1 documentation.
http://www.leafdigital.com/articles/jspinstall.html

find DirectoryIndex in the httpd.conf file, and change the line to
DirectoryIndex index.jsp
This will load index.jsp in your documentroot when you goto http://localhost

Something to add to the server.xml file under tomcat/conf is

<Context path=“” docBase=“c:/www/Apache2/htdocs” debug=“0” reloadable=“true” crossContext=“true”/>

docBase should be set to your documentroot path. All this lets you set your documentroot to a jsp page so that it does not just display the source code.

Now if you could explain how eclipse ties into this all, that would be great … I like it anyway, this exactly what i was looking for, just as i was looking for it … Nice timing

Personally I don’t see the need for downloading Apache seperately.
You can just grab Tomcat, make a few quick config changes and you’re set to go.
Eclipse also has a nice plugin for managing tomcat and tomcat projects available.

What if you wanted to have any JSP in any nested directory under the base Apache server path (htdocs default) to run?

If you’re having problems making the count.jsp example work look here:

Thank you so much! I have spent the past 10 hours surfing the web in a futile effort in trying to connect Apache with Tomcat using JK. You’re a lifesaver! Jakarta should pay you a handsome sum of money and put this tutorial in place of all that junk they have on their site.

Exellent article;

It got me going in a flash. I was struggling
with all the suggestions in the internet to
get Apache and Tomcat5 working wasting lot of time. But this one got me on my feet in
less than 10 minutes.

thanx and a great job

Jchet

Thanks! After trying a few different approaches to get Apache2 and Tomcat5.5 working together, this one worked extremely well. As for beginner Java books, I’d recommend Thinking In Java 3rd Edition by Bruce Eckel, available online for free or on CD-ROM or paper for cheap. Also available from that site is Thinking In Enterprise Java, which is still in preliminary stages but a good JSP/Servlet/Socket/XML resource nontheless.

How can I run the JSP pages fron the Apache htdocs directory, instead of putting the JSP pages in the webapps directory of Tomcat.

hi!. the elusive mod_jk2 seems to be elude the apache version 1.3.29. I keep getting the error message"SYNTAX ERROR: CANNOT LOAD THE MODULE. THE MODULE IS NOT AVAILABLE" and the line points to the apache httpd.conf file where the LOAD MODULE DIRECTIVE is declared.
any suggestion how to resolve it.

Very Helpful and useful article.

Thanks for very informative article

It seems from the Tomcat website that mod_jk2 is now deprecated… The basic article seemed very helpful - could an updated version be posted referencing Apache 2.x and Tomcat 5?

i also read the article, didnt have the need to use apache, just tomcat5, but, when i restart my pc tomcat isnt running, even if i configure it to start service = automatic

can anyone help me , pls?

TiA

a big help for beginners like me…many thanks… :slight_smile:

Great article, accurate and complete. I’m using Tomcat 5.0.28, Apache 2.0.55, and Tomcat connectors 2.0.49. I was looking for some quick info on adding mod_jk2 and apache to an existing Tomcat instance. Thanks, I’m up and running!

Brilliant article. Spent hours messing around with Wrox Tomcat book trying to decipher tons of XML, when all you want to do is get the thing working first, and then learn by experimentation. It’s depressing when you can’t even get started.
Hate to say it, but Sun should really take this in hand, if Microsoft had done Tomcat it would be done in 10 minutes by pressing a few buttons. Guess that’s why Microsoft make money and Sun don’t.
Still brilliant article, told me what I needed to know, thank you.
Ian

thanks man !!!
saw 100 ways to run jsp files
but only urs worked
u r great :slight_smile:
thanks :slight_smile:

Wonderful article. Was looking for information on getting started with jsp as a means of upgrading my java skills. This has definitely cleared up many things for me.