Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.