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 want to serve a home dir from apache but it's going to a permission denied error.

I am using Ubuntu 11.04 with Apache2. The error in the log file is:

[Tue Jun 21 15:55:34 2011] [crit] [client 127.0.0.1] (13)Permission denied: /home/pedro/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable.

In an older installation of ubuntu that I had, I was getting the same error and I had just enabled mod_userdir for apache and all worked fine, but know even if I enable this mod it doesn't work.

The dir permissions that I tried to serve:

drwxr-xr-x  8 pedro pedro 4096 2011-06-20 20:55 .
drwxr-xr-x  4 pedro pedro 4096 2011-06-20 19:39 ..
drwxr-xr-x 13 pedro pedro 4096 2011-06-20 19:39 app
drwxr-xr-x  6 pedro pedro 4096 2011-06-20 19:39 cake
-rwxr-xr-x  1 pedro pedro 6526 2011-06-20 19:39 gerenciador_eventos.sql
drwxr-xr-x  8 pedro pedro 4096 2011-06-20 19:39 .git
-rwxr-xr-x  1 pedro pedro   87 2011-06-20 19:39 .gitignore
-rwxr-xr-x  1 pedro pedro  295 2011-06-20 19:39 .htaccess
-rwxr-xr-x  1 pedro pedro 1850 2011-06-20 19:39 index.php
drwxr-xr-x  4 pedro pedro 4096 2011-06-20 19:39 players
drwxr-xr-x  2 pedro pedro 4096 2011-06-20 19:39 plugins
-rw-r--r--  1 pedro pedro 3330 2011-06-20 19:39 relatorio.backup
drwxr-xr-x  4 pedro pedro 4096 2011-06-20 19:39 vendors

The virtualhost config that I am using:

<VirtualHost *:80>
    ServerName gerenciador_eventos

    DocumentRoot /home/pedro/dev/k2tv/gerenciador_eventos

</VirtualHost>

It is weird becouse when I was using the Ubuntu 10.10 it was working perfectly, unless I am missing some confirmation, but I don't think so.

share|improve this question
1  
Need ls -ld of / and /home and /home/pedro. Also check audit.log to see if SELinux is unhappy with your choice of userdir. –  DerfK Jun 21 '11 at 19:17

1 Answer 1

Make sure Apache has +x (execute) permissions on all parent directories: /, /home, /home/pedro and so on.

If standard Unix permissions are used (i.e. no ACLs), this command will help:

namei -l /home/pedro/dev/k2tv/gerenciador_eventos
share|improve this answer
1  
Never heard of the namei command before. Thanks for the tip! –  Mark Wagner Jun 21 '11 at 19:43

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.