Warning

This document hasn't been checked for compatibility with current versions of Plone. Use at your own risk.

htaccess + proxy

by Tom "Spanky" Kapanka last modified Dec 06, 2009 09:28 PM
How to password protect an entire site with apache's authentication and proxy rewrite.

I have a site that I'm using mod_proxy with in order to use the VirtualHost stuff, but I wanted the entire thing password protected while I developed the site.

Here's what I added to my apache configuration file to make it work:

 

<Location "/">

    ProxyPass http://127.0.0.1:3699/VirtualHostBase/http/my.site.com:80/plone/VirtualHostRoot/
    ProxyPassReverse http://127.0.0.1:3699/VirtualHostBase/http/my.site.com:80/plone/VirtualHostRoot/

    AuthType Basic
    AuthName "Password Required"
    AuthUserFile /home/plone_user/htpasswd.file
    Require user user

</Location>

 

You'll need to make an htpasswd file somewhere.  I used the home folder of the user that I use to run this instance with.

Worked like a charm!  Hope this helps others.


Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.