Putting a site behind HTTP Authentication is a pretty simple task, but when your site is being served by another application server – let's say Zope (Plone) for example, the method isn't as obvious.

The example VirtualHost stanza below should help:

<VirtualHost *:80>
  ServerName www.mysite.com
  <Location />
  AuthType Basic
  AuthName "Login Here"
  AuthUserFile /var/www/html/passwords   # the password file created with htpasswd
  Require user some_user_name
  RewriteEngine On
  RewriteRule ^/(.*){HTTP_HOST}:80/my-plone-site.com/VirtualHostRoot/$1 [L,P]


Leave a Reply

Your email address will not be published. Required fields are marked *