Gentoo Archives: gentoo-user

From: thelma@×××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Apache 2.4 can not access server subdirectory
Date: Thu, 29 Oct 2020 19:59:44
Message-Id: d703975a-4210-5f35-fe1f-52f097e5f7dc@sys-concept.com
In Reply to: Re: [gentoo-user] Apache 2.4 can not access server subdirectory by Michael
1 On 10/29/2020 10:53 AM, Michael wrote:
2 > On Thursday, 29 October 2020 14:10:07 GMT thelma@×××××××××××.com wrote:
3 >> On 10/29/2020 06:21 AM, Remco Rijnders wrote:
4 >>> On Wed, Oct 28, 2020 at 10:36:12PM -0600, thelma wrote in
5 >>>
6 >>> <7b3d3416-77b0-02eb-ad05-f717fdf0b6a4@×××××××××××.com>:
7 >>>> After installing apache 2.4 I can not access server subdirectory:
8 >>>> server/admin/index.html
9 >>>>
10 >>>> Forbiden
11 >>>> You don't have permission to access /admin/index.html on this server
12 >>>>
13 >>>> I can access index.html in a directory below /admin (server/index.html)
14 >>>> but not the server/admin/index.html
15 >>>
16 >>> That seems to suggest that either the permissions or ownership of
17 >>> admin/index.html are different from admin/server/index.html, or that
18 >>> there is a
19 >>> difference of that kind between the directories admin/ and admin/server.
20 >>> Are
21 >>> they?
22 >>
23 >> Here are the permissions:
24 >>
25 >> index on server/
26 >> -rw-r--r-- 1 root root 19078 Jan 14 2011 index.php
27 >
28 > The above is a .php file.
29
30 Yes, it is and I can read that file. The files that I can not access
31 are in:
32 server/admin/index.html
33
34 >
35 >
36 >> index on server/admin/
37 >> drwxr-xr-x 6 root root 4096 Oct 28 22:08 admin
38 >> -rwxrwxrwx 1 apache apache 428 Oct 28 16:44 index.html
39 >
40 > You shouldn't need apache:apache or 0777 ownership of this file which is very
41 > insecure, unless apache is meant to be editing it live. Normally root:root
42 > and 0755 is what is used.
43
44 Yes, I'll change that. I just use it temporarily as I run out of ideas
45 to try :-/
46
47 >
48 > Is 'server/' a subdirectory of '/var/www/'?
49
50 Yes
51
52 > .htaccess won't work if you have disabled it with 'AllowOverride None'.
53
54 Thank you for the pointer. I just change this directive in apache.conf
55 for /var/www/ and restarted apache but there is no difference. I still
56 can not access /server/admin/ directory from apache. server =
57 /var/www/html/catalog/
58
59 This is from apache.conf
60
61 <Directory />
62 Options FollowSymLinks
63 AllowOverride None
64 Require all denied
65 </Directory>
66
67 <Directory /usr/share>
68 AllowOverride None
69 Require all granted
70 </Directory>
71
72 <Directory /var/www/>
73 Options FollowSymLinks
74 AllowOverride All
75 Require all granted
76 </Directory>
77
78 I just search all server .htaccess files for "AllowOverride" but none is
79 active in these files.
80 grep -Rnw '/var/www/html/catalog/' -e 'AllowOverride'
81
82 >
83 >> It works on Apache 2.2 but not Apache 2.4
84 >
85 > Directives changed on version 2.4. It would be worth familiarising yourself
86 > with the latest:
87 >
88 > https://httpd.apache.org/docs/2.4/upgrading.html
89 >

Replies

Subject Author
Re: [gentoo-user] Apache 2.4 can not access server subdirectory Michael <confabulate@××××××××.com>