Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wish to create a password protected vhost for selected clients (

We have a windows reverse proxy with some vhosts (www, static, secure). I am not using htaccess files as this is a reverse proxy and website is served by another back end server

How could I set up a password? I am using .conf files for our vhosts

share|improve this question

I would imagine it could be done the same way you would protect a normal directory

<VirtualHost site:80>
    ServerName ...
    <Location /proxypath/>
        AuthType Basic
        AuthName "Restricted Files"
        AuthUserFile /usr/local/apache/passwd/passwords
        Require user rbowen

    ProxyPass /proxypath/ ...
</VirtualHost >

Then use the htpasswd utility to generate a .htpasswd file

share|improve this answer
Thank for your help, but Apache won't restart with this... <virtualHost *> ServerName ServerAlias ServerAlias ServerAdmin DirectoryIndex index.htm ProxyPass /cgi-vel/web/ localhost:82/cgi-vel/web keepalive=on ProxyPass / localhost:82/cgi-vel/web keepalive=on ProxyPassReverse / localhost:82/cgi-vel/web keepalive=on ProxyPreserveHost On ErrorLog "logs/test_web_error.log" CustomLog "logs/test_web-access.log" combined </virtualHost> – Raul Taboraz Nov 23 '11 at 10:43
@RaulTaboraz Does it give you an error? – Smudge Nov 23 '11 at 10:51
yes, apache does not start... I am sorry for delay and wrong code. I have really solved today, adding password required to "static" vhost, not reverse proxy. Thank you anyway – Raul Taboraz Nov 27 '11 at 19:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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