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

I have Zend Server installed and noticed something like the following was added to my httpd.conf file:

<Location /ZendServer>
 Order Allow,Deny
 Allow from 127.0.0.1
</Location>

Alias /ZendServer "C:\Program Files\Zend\ZendServer\GUI\html"

<Directory "C:\Program Files\Zend\ZendServer\GUI\html">
 AllowOverride All
</Directory>

But I can't seem to understand the difference between Location and Directory. I changed to something like the following, which makes more sense to me, and it still works:

<Location /ZendServer>
 AllowOverride All
 Order Allow,Deny
 Allow from 127.0.0.1
</Location>

Alias /ZendServer "C:\Program Files\Zend\ZendServer\GUI\html"

Can I keep my changes or should I put it back the way it was?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Directory directive works only for filesystem objects (e.g. /var/www/mypage, C:\www\mypage), while Location directive works only for URLs (the part after your site domain name, e.g. www.mypage.com/mylocation).

The usage is straightforward - you would use Location if you need to fine tune access rights by an URL, and you would use Directory if you need to control access rights to a directory (and its subdirectories) in the filesystem.

share|improve this answer
    
I'm still confused... Why did Zend used both then? Can I keep my changes or is something wrong with that? –  Ricardo Amaral Nov 1 '10 at 16:51
1  
No, your configuration is not the same as the original one - you removed AllowOverride from Directory directive, and that means you won't be able to use .htaccess file in C:\Program Files\Zend\ZendServer\GUI\html directory. Directory options setup are different from URL options setup, that's why they used both of them. –  ipozgaj Nov 1 '10 at 17:13

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.