I'm trying to setting up custom errors over Apache2.4 (Over Suse Linux) in my site (my computer).

The highest problem I encountered is when I set up a directory with flag "no permission" with chmod like

sudo chmod 000 /path/rootapachefolder/subfolder

to set up the folder as Forbidden (Access denied for all World and also for Apache)

The server gives me back the error

<!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.Server unable to read htaccess file, denying access to be safe</p>
</body>
</html>

and seems not follow the line putted up in .htaccess file in the root folder

ErrorDocument 403 /errors/403

but the ErrorDocument line it's followed when I make a folder with a .htaccess file like this

Require all denied

EDIT:

Also note that if the command sudo chmod 000 /path/rootapachefolder/subfolder/file.ext is executed for a file and not for a folder [and obviously the file has an extension different from php that it have to be runned up in a processor (something like .doc)] the Apache ErrorDocument directive it's followed. So the error comes from the inability of Apache2 to read the .htaccess file in the subfolder, also if there's an .htaccess file in the upper directory or root directory.

This head it's going a little bit mad and it's smoking.

Why this? And how to solve it and make it follow the error in ErrorDocument? Or, if it's impossibile, there's an opportunity to edit the default Apache error?

0

There are 0 best solutions below