Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a Ubuntu Linux user (Lucid Lynx) who is running Apache. I have a collection of zip files in a folder in my home directory (~/zip_files) which I would like to be able to link to through apache, such that when somebody who visits my website which I'm using Apache to host clicks a link to one of the zip files, he can download it through the web. How can I provide Apache with access to the files and set the permissions? Thanks, I'm new to linux!

share|improve this question
up vote 3 down vote accepted

There are two approaches that you can take:

  1. Change the DocumentRoot in your Apache conf file to your home directory. This will immediately serve your documents across HTTP. You will need to reload Apache to see the change.

  2. The second approach is to use a symlink. Symlinks are essentially references to other files or folders. In the directory /var/www type:

    ln -s /var/www /home/username

    This is a good description of symlink. You will still need to set the FollowSymLinks option in the Apache conf and reload Apache.

For both approaches, make sure that the folder permissions are at least 755 (use chmod 755 /home/username) to ensure the permissions are correct.

share|improve this answer

Apache has a feature that allows for per user web directories which lets people access your files using

You could combine this with the symlink idea

ln -s zip public_html


mkdir public_html
cd public html 
ln -s ../zip zip

I think you need to tell Apache to follow symlinks.

You also need to set permissions on the directories and files so they are readable by the user under which Apache runs.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .