3

I have installed apache tomcat server on my machine for hosting some servlets. Now I want to put some files on this server so that user can download these files straight away. My question is is it possible to do this ? I mean can apache tomcat server act as a http server as well ? If yes, in which directory in tomcat server I should put these files ?

Please help,

cppdev
  • 6,833
  • 13
  • 40
  • 45
  • Possible duplicate of [How to serve static content from tomcat](https://stackoverflow.com/questions/2523262/how-to-serve-static-content-from-tomcat) – user207421 Oct 22 '17 at 00:30

2 Answers2

2

Several pointers (from Google):

http://denis-zhdanov.blogspot.com/2009/08/configure-tomcat-static-content.html

Stackoverflow: How to serve static content from tomcat

Community
  • 1
  • 1
Andrey Adamovich
  • 20,285
  • 14
  • 94
  • 132
  • In case that link ever goes dead, this worked for me: I have Tomcat's ROOT app in `/var/lib/tomcat8/webapps/ROOT/`. If I access `:`, I get the "It works!" page. I created a `static` folder inside the `ROOT` folder, placed files inside and was able to access them from `:/static/file_name`. This despite several settings that broke some other more or less related things. – GuiRitter Oct 22 '18 at 18:21
0

Enable the file listing in conf/web.xml and then delete all the files in webapps/root directory and replace it with the files you want to transfer.

The below link could be helpful

https://www.youtube.com/watch?v=pJPOBKLYZYY

Minisha
  • 2,117
  • 2
  • 25
  • 56