Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am on Ubuntu 8.10, and generally share my content with ppl on LAN by creating soft links in Apache2 document root to the intended directory. So if I want to share my Videos directory I will

  1. CD /var/www
  2. ln -s ~/Videos/ video

    Then http:/// would list video directory to other users.

I am facing problem when I try the same thing for my external USB drive. The link gets created fine. From command line I can use the link just like other links, but apache does not show this directory on browser. I have checked the ownership and privileges. They are all fine.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

Apache won't follow symbolic links unless you specify the FollowSymLinks option in the config file, but I really don't like symlinking out of the web space. Once you allow them, then you've got a potential security risk, if a link is created then it could serve out some sensitive information.

The right way to do this is to add an alias into the apache configuration. Create a file in /etc/apache2/conf.d with contents something like this

Alias /video/ "/home/aakash/Videos"
<Directory "/home/aakash/Videos/">
        Options Indexes MultiViews
        AllowOverride None
</Directory>

This will mean that http://example.com/video will be served from your Videos directory.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.