I have Apache 2.4 with PHP 5.5.14 installed on latest Debian. According to Apache security tips&tricks I've set my httpd.conf to this:
<Directory />
AllowOverride none
Require all denied
</Directory>
<Directory "/var/www">
Options FollowSymLinks
AllowOverride none
Require all granted
</Directory>
I restart the Apache server and run this PHP code:
<?php
$filename = "/etc/passwd";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo($contents);
?>
The code gets the whole /etc/passwd file and I consider it a huge security issue. Now, I've been trying to solve this for a couple of days now simply by reading the manuals, but I had no luck yet. I'd appreacte a push in the right directions, thanx.