image servlet tomcat apache
I need some advise on the architecture.
Requirment :
- Users need to upload and download images.开发者_如何学JAVA
- Secure -- Only users logged in should be able to upload/download the images.
- Scalable.
- Load the image from a location independent of the App server location. the content could be stored on shared drives.
Different Approach, I could think of :
Currently we have a prototype developed based of servlet. It works pretty well. (I am not sure if this is scalable approach though). My servlet gets the request which sets the mime type and returns the image content.
Configure Apache(in front of Tomcat) to render images but I am not sure how to enable security so that only the user who uploaded the image can download.
Can you please suggest a better approach ?
thank you
I'd go for the servlet approach. If the servlet code is well written, I don't forsee scalability problems. This is more a concern of the servletcontainer itself (and the hardware used). Delegating this task to apache is doable, but keeping the authentication in sync may become a pain. I have never done it before, but in theory, your best bet would be a shared database and use mod_auth_db(m)
in Apache HTTPD and JDBCRealm
in Apache Tomcat.
精彩评论