Forum Moderators: phranque

Message Too Old, No Replies

Apache 2 and the case of the disappearing htpasswded directories

This is a good one, and Dreamhost don't have a clue

         

christopherwoods

10:34 pm on Jan 31, 2007 (gmt 0)

10+ Year Member



I've scouted about pon the web for AGES trying to find a solution. Nearest to an idea I've come is something mentioned about one of the WebDAV modules being incompatible with all versions of Apache 2 between an odd one and one a couple of minor versions past the flavour of Apache which is runnning my site, but I don't thiiiiiink that's causing the problem.

Here's my setup:

PHP 5.1.2, compiled with the following options (out of my control):

'./configure' '--prefix=/usr/local/php5' '--enable-fastcgi' '--with-mysql=/usr' '--enable-calendar' '--enable-force-cgi-redirect' '--with-config-file-path=/etc/php5/cgi' '--enable-trans-sid' '--with-gd' '--with-xml' '--with-xsl' '--with-ttf=/usr' '--with-freetype-dir=/usr' '--enable-exif' '--with-xslt' '--with-xslt-sablot=/usr' '--with-dom-xslt=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr' '--with-pdo-mysql' '--enable-ftp' '--with-curl=/usr' '--with-pspell=/usr' '--enable-mbstring' '--with-mcrypt' '--with-mysqli' '--with-openssl=/usr' '--with-gettext'

PHP's running as a CGI module, also again out of my control.

Server line:

Apache/2.0.54 (Unix) PHP/4.4.4 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.3.2 (yeah, it says PHP/4.4.4 but trust me, it's 5.1.2, with Dreamhost they give you either PHP4 or PHP5 as an option, phpinfo is reporting 5.1.2).

This is my problem: I have a directory which contains extracted homedir backups from some of my other sites - I'm moving the content across from one server to another, and the simplest way to do it was to grab everything, tarball it, wget the tarball to the new site and extract everything to a new dir. So, I've done it all in subdirectories underneath my <site.tld>/backups folder. To give me some semblance of privacy, I slapped an htpasswd basic auth onto the folder, same as I've done a million times before. However, the moment I did this... The folder disappears from the directory listings. You rename the .htaccess to something else (so it's not parsed), and the folder reappears.

This happens on any folder I apply an htpasswd-based authentication to - which means that I have no way of requiring a password. But, by the same token, I'd raaather not have folders which refuse to show unless they're not passworded!

I've had a lengthly back-and-forward with Dreamhost support, and they've said, pretty much, 'Our Apache config is, for all intents and purpose, pretty standard, there's no reason at our end for this happening'. They couldn't come up with a solution aside from renaming the htaccess files. Hardly desirable.

I've literally SCOURED the webbernet to try and find a solution - or at the very least, an explanation! - for this behaviour, does anybody on here have the slightest idea where to start with this? Having folders which refuse to show up if they're passworded is both annoying and a bit of a hindrance for the various things I'm trying to achieve with my webhosting! Any tips or suggestions are greatly appreciated.

This never happened with my old hosting (on Apache 1.3, PHP5), and I've doublechecked, triple, quadruple checked my htaccess and htpasswd config (and double blind verified it by using Dreamhost's built-in folder password creator on their control panel, which produces an identically-configured htaccess and htpasswd combo!

Anybody have a clue?

phranque

10:57 pm on Jan 31, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the only weird things i can think of are some type of browser cache issue (try closing browser and starting new session after installing .htaccess) or an authorization realm mismatch (make sure the .htaccess has similar AuthName directive)

you might also check permissions - can apache access the .htaccess, password and group files/dirs?

japhar

12:02 am on Feb 1, 2007 (gmt 0)

10+ Year Member



Hey christopherwoods,

Try add ShowForbidden to IndexOptions (conf/extra/httpd-autoindex.conf - apache 2.2)

Should help :)