Solved

Mapping welcome-file (index.jsp) to tomcat

Posted on 2004-09-01
4
943 Views
Last Modified: 2008-01-09
Hi.

I'm trying to map ALL index.jsp files through apache to tomcat.
Basically I want to be able to create subdirs in my tomcat root context and just throw an index.jsp in there without having to map the directory in workers2.properties.

Example:

in httpd.conf -
...
DirectoryIndex index.jsp
...


in workers2.properties -
...
[uri:www.mydomain.com:80/*.jsp]
worker=ajp13:localhost:8009
...

Now I want to create a folder/file in my tomcat context like this:
/testdir/index.jsp


When i do this, I can hit: http://www.mydomain.com/  and it picks up the index.jsp and forwards to tomcat just fine.
But when i hit: http://www.mydomain.com/testdir/  I get a 404 from apache.  (not forwarding to tomcat)

anyone know how i can resolve this without having to map every subdirectory in workers2.properties?
0
Comment
Question by:jdoklovic
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:ramazanyich
ID: 11956541
add followinf mapping to you workers.properties:
# Uri mapping
[uri:/testdir/*]
worker=ajp13:localhost:8009
0
 
LVL 1

Author Comment

by:jdoklovic
ID: 11956711
see the last line in my initial post.....

"anyone know how i can resolve this without having to map every subdirectory in workers2.properties?"
0
 
LVL 19

Accepted Solution

by:
ramazanyich earned 500 total points
ID: 11956807
testdir/* will map all subdirectories under testdir.
Just try it.
0
 
LVL 1

Author Comment

by:jdoklovic
ID: 11956985
The problem is that if i create a directory under testdir like: testdir/test/  and then try to go to:
http://www.mydomain.com/testdir/test/
it never gets to tomcat because the test  directory doesn't exist under the apache root, and so it throw a 404.

I think i found my answer though.....
if i just create empty directories under apache that match the real ones under tomcat, then apache finds th directory and tries to load index.jsp, which in turn forwards the request to tomcat.

thanks anyway though.

- Jonathan
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question