I had to figure out some Apache stuff today, so that I could password protect a web directory for the new group weblog I’m working on with a few other collaborators (we’ll be covering marketing issues and the like) so I asked our sysadmin for some help, and read a few tutorials.
[note: I realize most of you won’t need to read these quick tutorials, but I might need them again someday, so I’m ‘blogmarking’ them (sort of like bookmarking, but always available to me, no matter where I am physically).]
Once I complete the first tutorial’s directions, it wasn’t working as I’d hoped (it’s never as easy as it seems). So Apokalytik helped me figure out that I needed to modify the “Directory” part of the httpd.conf file:
Then I had to make a symlink for htpasswd in the /usr/bin directory, which Apokalytik showed me how to do.
After I added the .htaccess and .htpasswd file and restarted apache, all was good, and the directories are now protected.
I love Mac OS X because the built in terminal + airport let me do all of this from the comfort of my couch…
[updated: 10/5/2003] FYI, the htpasswd manual page from the Apache documentation is a useful page to have bookmarked, if you forget how to set a password.