• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Restricting directory access in Tomcat

 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am developing a personal site that hosts my MP3 collection. I have a created a nice db and a couple of servlets/jsp pages that access the files and create a playlist according to some parameters from user (artist=Beatles, etc.).
Due to the copyright issues and stuff, I would like to do the following.
1. Assume that my song is in a location called http://www.mysite.com/music/Beatles/eightdays.mp3
2. Assume that my jsp is in a location called http://www.mysite.com/music/index.jsp
My dilemma is this.
I would like to give access in Tomcat (4.0) in such a way that when I acess the URL in (1) from URL in (2), it should be able to do so without a problem, but
When someone directly accesses URL in (1), it should be denied.
In other words, a particular directory in my site should be accessible from the links in my own site, but should be inaccessible to direct queries from other sites (external IPs).
Ex.
Access from IP 1.2.3.4 (my site) to 'Beatles' directory should be allowed.
Access from IP 3.4.5.6 (any other site) to 'Beatles' directory should be denied.
Is there anyway to achieve this in Tomcat?? Any help would be greatly appreciated.
reply
    Bookmark Topic Watch Topic
  • New Topic