I want to protect an entire virtual host in Apache, but I still want to allow public access to a single file. The virtual host proxies all requests to a Tomcat server on the back end. What's the best way to do this?
I tried setting up my virtual host definition as follows, but it still requires a password for the file I want to be exposed publicly:
<VirtualHost *>
ServerName example.com
<Location / >
Order Allow,Deny
Allow from all
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /etc/apache2/secrets.htpasswd
Require valid-user
</Location>
<Location /foo/bar.html>
Order Allow,Deny
Allow from all
</Location>
</VirtualHost>
Any suggestions?