Re: ldirectord config for web server behind authentication
Horms <[email protected]>
| Newsgroups | gmane.linux.highavailability.ultramonkey |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 5 Jul 2006 11:36:47 +0100, Imran Aziz wrote: > [-- text/plain, encoding 7bit, charset: ISO-8859-1, 48 lines --] > > Thank you very much for the response. > > For the time being I have used the apache "Satisfy any" directive to sort > out this issue, by allowing requests from our IP address to come through and > show basic authentication to the rest. My Apache config now looks like this > > > <Directory "/var/www/html/wwwroot"> > Options Indexes FollowSymLinks Includes > order deny,allow > deny from all > Allow from xx.xxx.xxx > AuthType Basic > AuthName "Protected Area" > AuthUserFile /usr/local/apache/passwd/pass > Require user username > Satisfy any > </Directory > > This has sorted out my issue. > > Imran > > On 7/5/06, Horms <[email protected]> wrote: >> >> On Tue, 4 Jul 2006 18:06:02 +0100, Imran Aziz wrote: >> > [-- text/plain, encoding 7bit, charset: ISO-8859-1, 31 lines --] >> > >> > Hello All, >> > >> > I want to know the configuration paramters to specify authentication >> details >> > for the http site on real server, like what should be the addition >> > configuration in ldirectord to enable the director to consider a server >> > alive behind an authentication? >> >> That is a good question. Off the top of my head I am not sure >> that ldirectord explicitly supports http authentication. >> >> Patches welcome :) Could you see if this patch works for you. It should allow you to specify the login and password parameter as part of a virtual service (see the example for ftp), and that login and password will be used for simple auth for all real servers belonging to the virtual service. -- Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/ Index: ldirectord =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/ldirectord/ldirectord,v retrieving revision 1.140 diff -u -r1.140 ldirectord --- ldirectord 6 Jul 2006 03:53:59 -0000 1.140 +++ ldirectord 6 Jul 2006 04:45:09 -0000 @@ -1803,6 +1821,12 @@ my $ua = new LWP::UserAgent(); $ua->timeout($$v{negotiatetimeout}); my $h = new HTTP::Headers("Host" => $virtualhost); + if (defined $$r{username}) { + $h->authorization_basic($$r{username}, $$r{password}) + } + elsif (defined $$v{username}) { + $h->authorization_basic($$v{username}, $$v{password}) + } my $req = new HTTP::Request("$$v{httpmethod}", "$$r{url}", $h); my $res; { -- Ultra Monkey - http://www.ultramonkey.org/ To UNSUBSCRIBE, email to [email protected], with a body: unsubscribe ultramonkey-users [email protected] where "[email protected]" is YOUR email address.