I wish to create a password protected vhost for selected clients (clients.mysite.com)

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

link|improve this question
feedback

1 Answer

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
    </Location>

    ProxyPass /proxypath/ ...
</VirtualHost >

Then use the htpasswd utility to generate a .htpasswd file

link|improve this answer
Thank for your help, but Apache won't restart with this... <virtualHost *> ServerName test3.mysite.com ServerAlias test3.mysite.com ServerAlias 192.168.1.250 ServerAdmin webmaster@mysite.com 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? – sam 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
feedback

Your Answer

 
or
required, but never shown

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