Apache and the case of the spurious permission snafu

(I especially enjoy the term "snafu", all the more so because of Snafu and Tarfu lakes -- "named with a WWII sensibility" -- on the highway south from Jake's Corner, Yukon, to Atlin, BC.)

Apache was running fine on my PC, serving up a PHP/MySQL app that I've been working on. I had set it up quickly to run from Apache's default htdocs directory, but it was high time to serve it from the subversion sandbox on another drive where My Documents maps (a couple of years ago I finally drank the Microsoft "My X" folder kool-aid). I added the proper Alias and <Directory> settings to httpd.conf, restarted, and expected to see the site.

Nope.

Instead, Firefox gave me its friendly error page and the Apache log mentioned a permissions problem with the new directory.

I'm running Windows XP Home with the Apache service running under the LocalSystem account, so I couldn't see how permissions would even enter the discussion: there aren't really supposed to be any ACLs in XP Home. But I did remember checking something during the XP install that mentioned not sharing my files with other accounts, so I jumped to the conclusion that My Documents had some permission dealie-o that was causing the problem. Now, I know that there's NTFS on the disk down there somewhere, and so I should be able to fiddle with the ACLs given the proper utility.

The little knowledge I've just described is very commonly known to be "dangerous".

It didn't take long to find a page describing three methods to twiddle with XP Home's NTFS permissions. I tried all three and, predictably, botched my drive but good.

So, time to reformat and copy the ~3.5GB of files back from my server. Maybe, I thought, that would even strip out any ACLs since the files were coming from a Samba share on Linux.

Nope. Apache still complains of a permission error.

I left it for the night and shut down, still frustrated and pretty much out of ideas.

Upon booting the next day, damned if Apache didn't serve up that web app from its new directory perfectly. Could it just have been a reboot? Apache should only need a restart and I had been restarting it with abandon the previous day. Did my ACL fiddling need a three-finger-salute somewhere along the way to lock in the changes? If so, that implies that ACLs really were the problem, instead of the red herring I believed them to be. Problems that magically fix themselves are Not Good.

You have just read a very boring anecdote.

Comments