Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When accessing a site defined in my local dev environment, I can't seem to get past a 403 Forbidden error.

Under /etc/apache2/sites-available/ I have defined a file fun.local:

<VirtualHost *:80>
        ServerName fun.local
        DocumentRoot /home/noah/work/fun
        ErrorLog /var/log/apache2/fun-error.log

        <Directory /home/noah/work/fun>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

The the apache error log for the site contains this error:

[Sat Aug 21 13:34:34 2010] [crit] [client 127.0.0.1] (13)Permission denied: /home/noah/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

I am running apache2 and ubuntu 10.04.

share|improve this question
    
Provide the output for ls -la on /home/noah –  Marco Ceppi Aug 22 '10 at 12:24
add comment

2 Answers 2

up vote 3 down vote accepted

Make sure to check the permissions on that directory. Realize that apache runs as the user 'www-data' and it will require read access to the files in that directory in order to function.

To check the permission run from the command line:

ls -al /home/noah/

Note that Apache figures out if a directory is able to be served by checking the whole path for .htaccess files. This is in case there's a rule in /home/noah/.htaccess that says things should be denied, overriding the information setup in your virtualhost file.

Allowing the www-data user to read the directory should help. The other thing you can do is to symlink the /home/noah/work/fun directory into /var/www where the apache user should be the default owner.

Let me know if you need more details or if you can get there from here.

share|improve this answer
    
I think the problem actually lies in the fact that my home directory is decrypted when I login, which makes it unaccessible to apache. –  Noah Goodrich Aug 22 '10 at 16:55
add comment

You can use apache userdir module to achieve this.
See this post for details: Apache symlinked to home directory - Permission Errors

share|improve this answer
add comment

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.