#1  
Old 23rd May 2008, 13: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
Code:
#!/bin/sh
user=$1
realm=$2
pass=$3

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

echo "$user:$realm:$hash"
htdigest file:
Code:
user1:test1111:MD5HASH
user2:test2222:MD5HASH
lighttpd auth conf:
Code:
$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"

        # THIS ONE DOESN'T WORK!!
        auth.require = ( "" => (
                   "method"  => "digest",
                   "realm"   => "test2222",
                   "require" => "user=user2"
                   )
        )
      
        # IF I USE THIS ONE, IT WORKS
        #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 13:04.
Reply With Quote
Sponsored Links
  #2  
Old 24th May 2008, 12:39
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

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?
__________________
Falko
--
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
  #3  
Old 24th May 2008, 14:16
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 216
Thanks: 1
Thanked 7 Times in 5 Posts
 
Default

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
Reply

Bookmarks

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 00:32
Question Regarding: Installing Lighttpd With PHP5 And MySQL Support On OpenSUSE 10.3 Gokou023 HOWTO-Related Questions 3 12th December 2007 16:06
Subdomain redirect to script as argument cooljai Server Operation 0 12th June 2007 16:41
PHP not processing on subdomain hybridstorm General 1 20th July 2006 13:29
Subdomain with Webspace nsm Installation/Configuration 1 13th June 2006 10:39


All times are GMT +2. The time now is 04:55.


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