I have terabytes of image data in F:\ on my server but that has gone full and now I have attached a storage device and mapped its folder as G:\. I want all the data to go in this so that the images are accessible to the application. I have changed the following
G:\ is here a folder on the storage device which has been mapped as a network folder G:\. If I access a file from command prompt or through run command such as opening a file G:\srv\images\abc.jpg, it works perfectly fine.
A web server is not a file server, so just because you defined G: as a network share and setup a Tomcat Context, that won't make G: accessible to web clients. In fact, since a Context defines an entire webapp, not just a data directory, using Context purely for data access doesn't really work anyway. You'd have to structure the Context target as a WAR.
Beyond that, I recommend reading the Tomcat docs carefully. For security reasons, Tomcat generally defaults to refusing to honor symbolic links in webapp resource paths and must be explicitly instructed to override that behavior.
From my own practical experience, putting a WAR on a network share resulted in I/O errors accessing the WAR, but that was back around Tomcat 5, plus there may have been local transport problems.
When it comes to destroying a civilization, gas chambers cannot hold a candle to echo chambers.
posted 5 years ago
Thanks a lot Tim!
I shall read the documentation. In that case, why is it working with F:\ where images are stored and that is a different drive than C:\ where Tomcat has been installed. What are practical ways to override these defaults explicitly. I use Tomcat 5.5
When you say you mapped a drive to G:, did you do that for the process in which Tomcat is running? If so, how did you do that?
posted 5 years ago
Hey Paul! I am using Microsoft Storage Server 2008 R2 and added it on the LAN. And then mapped a folder to G:\. I did not understand when you said if it has been mapped for the process in which Tomcat is running. Please elaborate.
Your Windows machine has many processes running on it. Have a look at the Task Manager if you have no idea about that. Right now my machine has 75 processes running. So when you map your G: drive to some folder somewhere, you just map it for the process which supports your GUI interface, and NOT for any of the other processes.