[Wed Sep 20 15:48:30.346550 2017] [core:error] [pid 25989] (13)Permission denied: [client 10.27.25.137:55602] AH00035: access to /myPage.html denied (filesystem path '/path/to/myPage.html') because search permissions are missing on a component of the path
User apache Group apache
User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP}
export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data
Main DocumentRoot: "/path/to"
This should do the trick, unless SE Linux is on the way. Red Hatoid users, keep on reading part 2
Enforcing
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden</h1> <p>You don't have permission to access this resource.</p> </body></html>
HTTP/1.1 200 OK
(contents of myPage.html)
type=AVC msg=audit(1505919935.243:23294): avc: denied { getattr } for pid=28387 comm="httpd" path="/path/to/myPage.html" dev="dm-2" ino=786435 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:unlabeled_t:s0 tclass=file
type=SYSCALL msg=audit(1505919935.243:23294): arch=c000003e syscall=4 success=no exit=-13 a0=7f511728e340 a1=7ffe6a31c6e0 a2=7ffe6a31c6e0 a3=7f510d20c792 items=1 ppid=28385 pid=28387 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
After upgrading Apache 2.2.x to Apache 2.4.10, /var/log/apache2/error.log started complaining :
[Sun Jan 03 15:55:13.845797 2016] [authz_core:error] [pid 2205:tid 139630284179200] [client 127.0.0.1:52045] AH01630: client denied by server configuration: /path/to/some/web/resource
The website we're considering is on a development workstation, and should only be accessed from that workstation. The virtualhost configuration had the following lines for Apache 2.2.x :
Order Deny,Allow Deny from all Allow from 127.0.0.1Which can be replaced, for Apache 2.4.10, with :
Require host 127.0.0.1
This is a quick fix, and the Apache documentation should be further studied before doing this to production servers.
ServerName myServerName
' > /etc/apache2/conf.d/fqdnServerName localhost
' >> /etc/apache2/apache2.conf127.0.0.1 localhost
(no more aliases are necessary / welcome)Please-leave-this-place-as-clean-as-it-was-when-you-arrivedtype : they add VirtualHosts to a shared Apache webserver (development platform) and just don't give a f*ck about the warnings at reload/restart when their VirtualHosts are not required / working anymore.
Warning: DocumentRoot [/path/to/docRoot1/] does not exist Warning: DocumentRoot [/path/to/docRoot2/] does not exist Warning: DocumentRoot [/path/to/docRoot3/] does not exist