I want to add basic authentication for a reverse proxy site of Apache running on Ubuntu server 12.04.1.
The web application is Jenkins that is running on a Java EE container.
I added below configurations in httpd.conf,
ProxyPass /jenkins/ http://localhost:8080/jenkins/¬
ProxyPassReverse /jenkins/ http://localhost:8080/jenkins/¬
ProxyRequests Off¬
ProxyPreserveHost On¬
¬
<Proxy http://localhost:8080/jenkins*>¬
Order deny,allow¬
Deny from all¬
▸ AllowOverride AuthConfig¬
▸ AuthType Basic¬
AuthName "jenkins"¬
▸ AuthBasicProvider file¬
AuthUserFile /etc/apache2/passfile¬
▸ Require valid-user¬
▸ Satisfy any¬
</Proxy>
When I used wrong password or non-exist username for authentication, I can find below messages in error.log of apache,
[Sat Oct 27 17:51:59 2012] [error] [client 222.128.175.95] user kane: authentication failure for "/jenkins/": Password Mismatch [Sat Oct 27 17:52:04 2012] [error] [client 222.128.175.95] user Aladdin not found: /jenkins/
There is no message will be logged when using right user and password in passfile. Though I input right user and password in web browser, the authentication dialog will prompt again. I also found below output in access.log of apache,
222.128.175.95 - kane [27/Oct/2012:17:39:54 +0800] "GET /jenkins/ HTTP/1.1" 401 794 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4"
Does anybody know how to make it work? Thanks.