Zach Shepherd's WordPress Blog

Just another WordPress weblog

Friday, November 30, 2007

Keep Apache from Displaying File Backups

It recently came to my attention that many people are unaware that apache will display the contents of a backup php file (e.g. “my1337password.php~”or “my1337password.php.bak”). This is because it doesn’t associate these files with the php parser. This can be easily prevented with a simple addition to the httpd.conf.

<Files ~ "\.(php|inc|config|cfg)(\~|\.bak|\.backup|\#)$">
Order allow,deny
Deny from all
Satisfy All

posted by Zach at 11:52 pm  

Sunday, September 30, 2007

Debugging Long MySQL Queries

I’ve found myself debugging long (several hundred lines when written neatly) MySQL queries the past two nights, really wishing I had some tool that would allow you to step through the query (sorta like gdb, but for sql). If anyone knows of such a tool (or has any tips on preventing issues dealing with arithmetic involving NULL), I’d be interested to hear from you!

If anyone stumbled across this hoping for suggestions on how to handle this, check the comments to see if anyone had any advice for me. My only suggestion is to start at the deepest query/queries and work your way out…

posted by Zach at 11:25 pm  

Powered by WordPress