Search code examples
jspamazon-web-servicesubuntu-12.04tomcat6

Files and images aren't visible when using URL, but work when using the IP address


I am working on a classic jsp app hosted on ubuntu/tomcat6 recently moved from rackspace to AWS. When I pull up the site using the IP address I can access files and images under the webroot/userFiles folder. When I access it off the URL, these same files and images return a 404 error. Everything else on the site works fine under either convention.

In other words this works:

http://xx.xx.xx.xx/userFiles/image1234.png

this does not work (returns 404):

http://mainsiteurl.com/userFiles/image1234.png

Any idea what could be causing the 404? I can see the DNS resolve appropriately and everything else on the site seems to return just fine.


Solution

  • So it turns out the people that had setup the server had installed the site twice and hadn't configured it correctly. One was in the base tomcat install and one was in a separate folder. I basically had to clean out one of the sites all together and treat the server (correctly) as having just one site installed. Thanks for the help everyone.