Old 23rd May 2008, 14:00
TheRudy TheRudy is offline
Senior Member
Join Date: Dec 2005
Posts: 216
Thanks: 1
Thanked 7 Times in 5 Posts
Default lighttpd, mod_auth, subdomain

I have a little problem actually i'm stuck really

I've set up a user1/password (digest) for main domain. It works just fine!
Then i've set up another user2/password (same password, different user) and set it for subdomain. Result, login doesn't work. The realm is set correctly for user2 login window.

If i change on subdomain user2 to user1, the login works.

Both lines for user/realm/password are in each own lines (2 lines). It appears that only 1st one is read.

I've read everything 10 times in lighttpd docs (not much to read to be honest), browsed their forums (not much help there either) and google doesn't produce anything useful.

Code that creates user/realm/password hash

hash=`echo -n "$user:$realm:$pass" | md5sum | cut -b -32`

echo "$user:$realm:$hash"
htdigest file:
lighttpd auth conf:
$HTTP["host"] =~ "^subdomain.domain.com$" {
        server.document-root = "/home/phpma/public_html"
        server.errorlog = "/home/phpma/logs/error.log"
        accesslog.filename = "/home/phpma/logs/access.log"

        auth.require = ( "" => (
                   "method"  => "digest",
                   "realm"   => "test2222",
                   "require" => "user=user2"
        #auth.require = ( "" => (
        #          "method"  => "digest",
        #          "realm"   => "test1111",
        #         "require" => "user=user1"
        #          )
I've tried everything i managed to google but nothing works

Anyone has any ideas?

Last edited by TheRudy; 23rd May 2008 at 14:04.
Reply With Quote
Sponsored Links
Old 24th May 2008, 13:39
falko falko is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts

If you change the order of the lines in htdigest (i.e., make the first line for user2), then user2 can log in, and user1 cannot?
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Old 24th May 2008, 15:16
TheRudy TheRudy is offline
Senior Member
Join Date: Dec 2005
Posts: 216
Thanks: 1
Thanked 7 Times in 5 Posts

Don't know why as i haven't changed anything but when i tried what you suggested it started working..

Now i changed the user order back to original and its still working.
Oh well..
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create a subdomain? torqhost Installation/Configuration 8 23rd February 2008 01:32
Question Regarding: Installing Lighttpd With PHP5 And MySQL Support On OpenSUSE 10.3 Gokou023 HOWTO-Related Questions 3 12th December 2007 17:06
Subdomain redirect to script as argument cooljai Server Operation 0 12th June 2007 17:41
PHP not processing on subdomain hybridstorm General 1 20th July 2006 14:29
Subdomain with Webspace nsm Installation/Configuration 1 13th June 2006 11:39

All times are GMT +2. The time now is 21:25.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.