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 just moved my projects into a new workstation. I'm having trouble getting my Apache installation to acknowledge my .htaccess files. This is my /etc/apache2/conf.d/dev config file:

<Directory /home/codemonkey/dev/myproject/>
    Options -Indexes
    AllowOverride All

    Order Allow,Deny
    Deny from all
</Directory>

I know the config file is being included by Apache because it complains if I put erroneous syntax in it (Action 'configtest' fails).

My project is reachable through Apache by a symlink in the /var/www directory. The server is running with my user and group, so it has my permissions. My entire dev folder has permissions set to 770 recursively.

Despite all this, I'm still getting an indexed display of my project folder when I visit http://localhost/myproject. Why isn't the above config making it impossible to view the folder in the browser?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

As clearly documented, symlinks followed by apache do not transfer access responsibility to the target directory.

share|improve this answer
    
Good to know. Changing line 1 in my config file to <Directory /var/www/myproject/> worked –  Hubro Mar 22 '12 at 16:39

Because apache sees this directory as /var/www/myproject, not /home/codemonkey/dev/myproject/ because it is a symlink. To fix this, just put the -Indexes in an .htaccess file in your myproject dir.

share|improve this answer

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.