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 am having this problem (apache2, ubuntu 12.04)

I have put all my sites in /home/username/vhosts folder I have added permissions to home and username to be x and chmod -r 777 on vhosts Added /etc/hosts to access my sites with desired names Did a2enmod rewrite

But still I have this error:

[Sat Jun 23 00:05:23 2012] [crit] [client 127.0.0.1] (13)Permission denied: /home/username/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

WHY is it not readable? I did

sudo -s
su - www-data

and with that I can correctly list the /home/username dir

What is wrong with me or apache?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

Check out if apache can access (+x) the /home, /home/user AND /home/user/vhost folder, as it normally checks the .htaccess down the tree.

share|improve this answer
    
You're probably more correct than me as it looks like the OP has bodged their error message. –  Iain Jun 22 '12 at 20:35
    
No I didn't: [Sat Jun 23 00:05:22 2012] [crit] [client 127.0.0.1] (13)Permission denied: /home/wade/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable [Sat Jun 23 00:05:23 2012] [crit] [client 127.0.0.1] (13)Permission denied: /home/wade/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable –  Basil Jun 22 '12 at 20:40
    
You can try this (for test) chmod a+x /home; chmod a+x /home/wade –  Andrew Smith Jun 22 '12 at 20:44
    
@Basil: what are the permissions on /home/wade/.htaccess ? ( ls -l /home/wade/.htaccess ) –  Iain Jun 22 '12 at 20:46
    
Did so. Nothing. How can I correctly pretend being apache? Is the way I use ok? –  Basil Jun 22 '12 at 20:48
show 1 more comment

I guess the permissions on the .htaccess file are incorrect try

chmod +r /home/username/.htaccess
share|improve this answer
    
Also check if apache can enter /home/username directory. –  Andrew Smith Jun 22 '12 at 20:18
    
@AndrewSmith: The error message the OP posted says /home/username/.htaccess ? –  Iain Jun 22 '12 at 20:20
    
Can you elaborate on how can I check it? I used "sudo -s su - www-data" commands to pretend to be www-data, and I can list all three dirs. Any other ways to check that? lain, yes, it does. –  Basil Jun 22 '12 at 20:23
    
I have no .htaccess in /home/username. Do I have to have it? –  Basil Jun 22 '12 at 20:30
1  
Erm Look at the error message you posted... It's late where you are - go to bed it'll be easier in the morning. –  Iain Jun 22 '12 at 20:32
show 1 more 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.