Question

What is the set up required to allow particular files to be downloaded from server?

Hello,

I have a droplet up and running in Digital Ocean. I am using tomcat7, postgres, nginx and Java.

I created a safari extension for my website and now want to move it to the server, so that i can give a link to the location and people can download and install the extension.

This link - http://stackoverflow.com/questions/10956587/how-to-create-a-downloadable-public-link-for-files-on-server, provided some answers. I moved the extension to location /var/www/ as mentioned in the link.But,I have not installed Apache2.(I wanted to know if we can do it by the stuff that i already have on the server). If i try to access the files using - http://sitename/extensionname.safariextz, i get a 404 error.

My questions are

  1. I have tomcat7 already, Can i give some permissions for tomcat to let it allow certain files to be downloaded?. Or do i need something Apache2.?
  2. Where should the downloadable file be placed in the server?

Appreciate any help, Thanks, Kavisha


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi,

For Tomcat, you’ll need to create link to the static content by modifying Tomcat’s server.xml configuration file to add this to the <Host> section:

<Context docBase="/home/stuff" path="/static" />

Replacing /home/stuff with the path to your static files, and path=“/static” with the path you want to use on your site for the files.