0

I've been experiencing a problem with my virtual hosts, I don't understand why apache looks for /home/* directory if my virtualhosts' directory is somewhere else?

tail -f /var/log/apache2/error.log
/home/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

Sultan

mzhaase
  • 3,778
  • 2
  • 19
  • 32
sultan
  • 287
  • 3
  • 10

4 Answers4

1

755 ist the answer, as all your files have to be readable by railo (which is actually not the same user as your Apache).

Wesley
  • 32,320
  • 9
  • 80
  • 116
Christian
  • 11
  • 1
0

It shouldn't. You must have this somewhere in your Apache configuration.

Or you have a softlink somewhere in your webdirectory/code to your home account.

Roald Nefs
  • 426
  • 5
  • 13
Arenstar
  • 3,592
  • 2
  • 24
  • 34
  • Actually my virtualhosts are stored in my /home/www/hostsdirectory does it affect somehow? – sultan Nov 12 '10 at 16:01
  • Well it seems that your webroot is then considered as /home/* as you said.. Apache by default looks in "every" directory for a .htaccess file.. You should probably look at you base document root in your httpd.conf file.. Also do you have any idea which vhosts is requesting your /home/.htaccess?? – Arenstar Nov 12 '10 at 16:04
  • I've about 10 virtual hosts and requests on allof them give the same result – sultan Nov 12 '10 at 16:06
  • Very strange.. Make sure your vhosts are having the document root set properly /home/www/website.com/ And check your code.. your might be referencing.. ../../../../image.jpeg or /home/www/website.com/../../image.jpeg – Arenstar Nov 12 '10 at 16:17
  • For sure I'd say this happens even if I setup some example.com with some "hello world" message within index file – sultan Nov 12 '10 at 16:42
  • Basically it sounds like your apache is not configured correctly.. and you have build your vhosts on top of this.. Try your hello world.. see what happens :D – Arenstar Nov 12 '10 at 16:57
0

Permissions on /home may not allow apache to read the directory appropriately.

The document root for the websites should be under /var/www or /srv/www. This allows you to have tight security on the home directory tree.

Specify the full DocumentRoot for your virtual servers.

Check that you haven't enabled user directories for your virtual servers. These will walk the /home tree.

Roald Nefs
  • 426
  • 5
  • 13
BillThor
  • 27,354
  • 3
  • 35
  • 69
0

Try to chmod 755 /home/www then do the same with "hostdirectory"

chmod 755 /home/www/hostdirestory
Lucas Kauffman
  • 16,818
  • 9
  • 57
  • 92