I got a minor problem (as the site is not high priority) but still a very interesting one.

I have an apache root domain wherein other sites live "/var/www/"

And I have foo.example.com forwarding to "/var/www/foo-example" (wordpress site)

The problem here is that when you go to foo.example.com you are prompted to enter credentials. If you hit cancel it gives you the access denied page.

But when you go to the servers' direct IP (this gives you the default index page) and hit cancel when prompted for credentials it just keeps giving you the login screen, and after pressing cancel a few times more it gives (a perhaps cached) bare html part of the page.

How do I prevent this from happening?

Perhaps this is a bug...

Even if I would block access to the root directory when going to the ip/foo-example it would still do this.

And I want to keep all the directories within the www directory or at least all in the same.

Thanks

PS:

here is my configuration:

<VirtualHost *:80>
  DocumentRoot /var/www/wp-xxxxxxx/
  ServerName beta.xxxxxxxxx.nl
  <Directory "/var/www/wp-xxxxxxxxx/">
    Options +Indexes
    AuthName "xxxxxxxx Beta Site"
    AuthType Basic
    require valid-user
    Satisfy all
    AuthBasicProvider file
    AuthUserFile /var/www/wp-xxxxxxx/.htxxxxxxxxx
    order deny,allow
    allow from all
  </Directory>
  ServerAdmin webhost@xxxxxxx.nl
  ServerAlias beta.xxxxxxx.nl
</VirtualHost>
link|improve this question
1  
It's not clear how your system is configured due to your anonymized configuration/description. Can we assume /var/www/foo-example, /var/www/wp-xxxxxxx and /var/www/wp-xxxxxxxxx are the same, as are foo.example.com, beta.xxxxxxx.nl and beta.xxxxxxxxx.nl? Please clarify. – Daniel Beck Nov 18 '11 at 10:47
feedback

1 Answer

Are you perhaps using mod_cache? When mod_cache is serving content, it doesn't check for access control. Not sure why that would affect the IP address but not the host name, but you could at least try disabling it to see if that solves the problem.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.