I'm trying to make my web server more secure, right now i'm attempting to put up a sort of "barrier" against directory traversal so a malicious user could not pass this if they found a way to perform such an attack.
The way I'm trying to do this is by having a folder layout as such: ( www being the furthest apache is allowed to go.)
/www/public_html/ #public contents
/ #private contents
I've found a way to deny all access after the web root, but i need things like PHP to be able to access private files like this
include '../private_file.php';
This is what i have so far in apache2.conf:
<Directory />
Order Deny,Allow
Deny from all
Options None
AllowOverride None
</Directory>
<Directory /www/public_html>
Order Allow,Deny
Allow from all
</Directory>
Does anyone know how I could do this?