Your Opinion on the Security of an External Connections File?

November 24th, 2007

QuestionAges and ages ago when I started coding for the web, I read somewhere that it was more secure to keep the file containing your password and sensitive variables outside of the public web root. I’ve always taken this as law, and I’ve jumped through all kinds of hoops to structure my sites and framework in this manner.

But is it necessary? I’d love your thoughts on the matter.

For Dreamweaver users, this is important for two reasons: 1) the Connections folder is placed automatically in your site definition’s file root, and 2) Dreamweaver freaks out and breaks in all kinds of new and interesting ways when the file root and the public web root are not the same.

If I’m jumping through all of these hoops unnecessarily, I’d like to do something about it and stop banging my head against a wall.

To clarify what I mean, let’s take a linux install where the home directory is “/var/www”, and the public web is served from “/var/www/html”. In this case, you’d set the Dreamweaver file root to “/var/www”. Thus, the Connections folder is kept outside the public web root. In theory, there’s no way this folder could be hacked through human/webmin error (forgetting to turn off apache indexing, for instance), or through some other means.

So my question to you, my loyal readers, is whether this is necessary. What are the implications to keeping the Connections folder inside the public web root? Do you consider this to be dangerous, or am I worrying unnecessarily?

Thoughts? Discuss.

Sphere: Related Content

  • Localhost doesn't work that way. Localhost is every computer's way of saying "me, myself, and I" meaning that when someone types in localhost, typically it goes to 127.0.0.1.

    That is, unless, someone has remapped localhost to go to another IP address via their hosts file, but that would be no different than typing the IP into your browser directly.

    No, if you got hacked, it would be for another reason.

    I might suggest posting this question to the Forums to see if anyone else has an idea:

    http://stringfoo.com/forums
  • Tim
    I was using MAMP PRO, but somehow my Sites folder was hacked by someone who decided to hook up my localhost root to their public web domain root.

    I'm guessing http://localhost/ being directed to my Sites folder was the cause of this?

    I'm not sure if this is why my MAMP PRO was so vulnerable.

    Anyone know how to secure the Sites folder properly?

    Should I use htaccess or soemthing to deny access?
blog comments powered by Disqus