WD My Book World lighttpd protected directories

On with WD My Book World adventures :)

Protecting web directories.

Edit
vim /etc/lighttpd/lighttpd.conf
Find


auth.require               = ( "/auth" =>
                               (
                                  "method"  => "digest",
                                  "realm"   => "nas admin",
                                  "require" => "valid-user"
# bruce - removed user=
#                                  "require" => "user=admin"
                               )

Add


,

                                "/custom" =>
                                (
                                  "method" => "digest",
                                  "realm" => "Authentication Needed",
                                  "require" => "valid-user"
                                )

Wrapped up


auth.require               = ( "/auth" =>
                               (
                                  "method"  => "digest",
                                  "realm"   => "nas admin",
                                  "require" => "valid-user"
# bruce - removed user=
#                                  "require" => "user=admin"
                               ),

                                "/custom" =>
                                (
                                  "method" => "digest",
                                  "realm" => "Authentication Needed",
                                  "require" => "valid-user"
                                )
)

Add as much as you like!

Now, add the user to the authentication backend file. The htdigest.sh was taken from lighttpd documentation wget http://www.fragmentized.net/Stuff/blog_files/17032008/htdigest.sh
sh htdigest.sh "user1" "Authentication Needed" "password123" >> /var/private/lighttpd.htdigest.user

And now we are able to have /usr/www/lib/custom http://my-book-ip/custom protected.