1

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?

mgorven
  • 30,615
  • 7
  • 79
  • 122
Basil
  • 21
  • 3

2 Answers2

4

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.

Andrew Smith
  • 1,143
  • 13
  • 23
  • You're probably more correct than me as it looks like the OP has bodged their error message. – user9517 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` ) – user9517 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
  • @lain, I haven't got this file... WAIT A MOMENT!!! I HAVE IT! It was empty with incorrect permissions! I have deleted it and VOILA! it works!! thank you, Lain (Iwakura? ) – Basil Jun 22 '12 at 20:51
1

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

chmod +r /home/username/.htaccess
user9517
  • 115,471
  • 20
  • 215
  • 297