Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an Apache2 vhost with the following Directory config:

<Directory /path/to/docroot>
    AuthType Basic
    AuthName styleguide
    AuthUserFile /etc/apache2/extras/ok_users
    Require valid-user
    Require group guest
    Order allow,deny
    Allow from 212.79.177.130
    Satisfy any
</Directory>

That works fine for all directories under the docroot, apart from one directory which is a symlink to a place outside of the docroot (/var/www/directoryname). Any requests for files in this directory throws up the auth dialogue. Once it's authenticated, it works fine.

I've used symlinks before in this way, but not encountered this from Apache before. Is there something about the symlink I should check for? Perhaps it's nothing to do with the symlink?

share|improve this question
    
So, I assume you're coming from that 212.79.177.130 address? Is there any config that applies only to the symlinked location, like an .htaccess file or a separate <Directory> block? –  Shane Madden Nov 23 '12 at 19:03
    
That's right, I'm on the Allow from IP. There's nothing else in the config that relates to that location, in fact there's only the bare minimum in there really. No .htaccess in the symlinked directory. –  Gilgongo Nov 24 '12 at 22:52
    
Does it work correctly if you switch the block to being configured as <Location /> instead of <Directory /path/to/docroot>? –  Shane Madden Nov 24 '12 at 23:45
    
That seems to have done the trick. Why though? I thought Location was simply for controlling stuff outside of the file system. Why would it cure this issue? –  Gilgongo Nov 27 '12 at 21:21
    
It's essentially just overriding the configuration from any other problematic configuration blocks, since it has higher precedence - see here. –  Shane Madden Nov 28 '12 at 1:19

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.