I have a PHP script running on my LAMP server that requires certain files in order to produce HTML content. The script is publicly accessible (i.e. http://example.com/script.php) but the files required by the script must secured. I could probably place the files in any directory other than /var/www and they would be relatively safe, but I'm trying to learn the Linux filesystem and I'd like to use the most appropriate place (according to FHS). Any help would be great.
Where to securely place files needed by PHP in Linux filesystem (according to FHS)
php;apache httpd;fhs
In /var/www, create a folder public_html and reconfigure that as your root directory for Apache. Files in /var/www can be included, but not accessed directly.