Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Apache 2.4 can not access server subdirectory
Date: Fri, 30 Oct 2020 10:32:19
Message-Id: 9786004.nUPlyArG6x@lenovo.localdomain
In Reply to: Re: [gentoo-user] Apache 2.4 can not access server subdirectory by thelma@sys-concept.com
1 On Thursday, 29 October 2020 19:59:45 GMT thelma@×××××××××××.com wrote:
2 > On 10/29/2020 10:53 AM, Michael wrote:
3 > > On Thursday, 29 October 2020 14:10:07 GMT thelma@×××××××××××.com wrote:
4
5 > >> Here are the permissions:
6 > >>
7 > >> index on server/
8 > >> -rw-r--r-- 1 root root 19078 Jan 14 2011 index.php
9 > >
10 > > The above is a .php file.
11 >
12 > Yes, it is and I can read that file. The files that I can not access
13 > are in:
14 > server/admin/index.html
15
16 > > Is 'server/' a subdirectory of '/var/www/'?
17 >
18 > Yes
19
20 I assume you have a directive for DocumentRoot?
21
22 e.g. I think the default is:
23
24 DocumentRoot "/var/www/localhost/htdocs"
25
26 and probably in your use case it would be:
27
28 DocumentRoot "/var/www/html/catalog" ?
29
30 Then if you point your browser to:
31
32 http://<IP_address>
33
34 it should display any index.html, or index.php, under catalog/, i.e.:
35
36 /var/www/html/catalog/index.html
37
38 it should *also* be able to display any other index.html under any
39 subdirectory, unless this has been explicitly blocked in some other specific
40 Directory, or Location directives, e.g.:
41
42 http://<IP_address>/admin
43
44 should display this index.html:
45
46 /var/www/html/catalog/admin/index.html
47
48
49 > > .htaccess won't work if you have disabled it with 'AllowOverride None'.
50 >
51 > Thank you for the pointer. I just change this directive in apache.conf
52 > for /var/www/ and restarted apache but there is no difference. I still
53 > can not access /server/admin/ directory from apache. server =
54 > /var/www/html/catalog/
55 >
56 > This is from apache.conf
57 >
58 > <Directory />
59 > Options FollowSymLinks
60 > AllowOverride None
61 > Require all denied
62 > </Directory>
63 >
64 > <Directory /usr/share>
65 > AllowOverride None
66 > Require all granted
67 > </Directory>
68 >
69 > <Directory /var/www/>
70 > Options FollowSymLinks
71 > AllowOverride All
72 > Require all granted
73 > </Directory>
74 >
75 > I just search all server .htaccess files for "AllowOverride" but none is
76 > active in these files.
77 > grep -Rnw '/var/www/html/catalog/' -e 'AllowOverride'
78
79 You wouldn't find "AllowOverride" within an .htaccess file. This is a
80 directive placed in the main /etc/apache2 configuration files to determine if
81 directives contained in local filesystem .htaccess files will be processed or
82 not. An 'AllowOverride None' will ignore .htaccess directives and make the
83 server speedier in responding to requests. TBH .htaccess are typically used
84 locally, when you are not allowed to make changes to the main apache
85 configuration files. Note, if you changed the name of ".htaccess" with the
86 'AccessFileName' directive, you may end up missing it.
87
88 Another thing to check is any changes to the default 'DirectoryIndex' types,
89 for the particular subdirectory. If you have removed index.html or
90 index.html.var in this directive then apache won't serve index files when a
91 directory like admin/ is requested.
92
93 Finally, you could increase the log verbosity to debug level and see if more
94 information is revealed as to the cause of this problem.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

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