Forum Moderators: phranque

Message Too Old, No Replies

404 shown for a file that exists

         

refresh2010

8:38 am on May 5, 2010 (gmt 0)

10+ Year Member



Hi all,

I'm new to Apache and Tomcat, here's my problem. I have two folders in the Tomcat webapps directory cas and idp, inside each folder there is a test.txt file, the file inside the cas folder displays in the browser, the file in the idp folder doesn't, I get a 404 error.

webapps
|_cas
| |
| test.txt
|
|_idp
|
test.txt


Why would this be? The 404 error is shown in the Apache access log.

172.16.0.5 - - [05/May/2010:09:00:15 +0100] "GET /cas/test.txt HTTP/1.1" 200 3
172.16.0.5 - - [05/May/2010:09:00:31 +0100] "GET /idp/test.txt HTTP/1.1" 404 952

Any suggestions on where I should look?

PS The path is correct, I've checked it many times.

Thanks
Steven

jdMorgan

12:41 pm on May 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If your installation is a typical Apache-front-end/Tomcat-back-end setup, then incoming HTTP requests for Tomcat apps are reverse-proxied from the front-end Apache server to Tomcat on the back-end. This is done using mod_proxy, by declaring which URL-paths (not filepaths) are to be forwarded to your application.

In this set-up, a likely cause of trouble is that while URL-paths starting with "/cas have been declared to be passed to Tomcat, those beginning with "/idp" have not.

So it could be something as simple as a missing ProxyPass directive in the server config file. I'm not a Tomcat user, so I don't know if you have to do this manually or if it is usually done as part of the installation process (i.e. using the installer script). If you do not have server config file access permissions, then the latter approach would be your only option in this case.

Jim