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

November 3, 2015 1.4k views
DigitalOcean Miscellaneous


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,

1 Answer


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.

Have another answer? Share your knowledge.