Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Mapping welcome-file (index.jsp) to tomcat

Posted on 2004-09-01
4
Medium Priority
?
951 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 1000 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

772 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