File:  [NetBSD Developer Wiki] / wikisrc / tutorials / lighttpd_on_netbsd.mdwn
Revision 1.7: download - view: text, annotated - select for diffs
Mon Nov 30 21:06:29 2020 UTC (10 months, 2 weeks ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by schmonz: Remove stat-cache instructions too, unneeded

    1: **Contents**
    2: 
    3: [[!toc]]
    4: 
    5: ## Installation
    6: 
    7: Via `pkgin` or `pkg_add` for platforms with binary packages available, or via pkgsrc thus:
    8: 
    9:     $ cd /usr/pkgsrc/www/lighttpd
   10:     $ make install clean clean-depends
   11: 
   12: 
   13: If you don’t have `PKG_RCD_SCRIPTS=yes` set, manually install the provided rc.d script:
   14: 
   15:     # cp /usr/pkg/share/examples/rc.d/lighttpd /etc/rc.d
   16: 
   17: And set `lighttpd=YES` in `/etc/rc.conf`. Then start the webserver with:
   18: 
   19:     /etc/rc.d/lighttpd start
   20: 
   21: Check your logs if you encounter any problem.
   22: 
   23: 
   24: ## Adding LDAP authentication
   25: 
   26: We will use OpenLdap.
   27: 
   28: First of all deploy a working ldap server, and populate it with the the users. For more information on this, read [[OpenLDAP Authentication on NetBSD|tutorials/openldap_authentication_on_netbsd]].
   29: 
   30: Be sure to load `mod_auth` and include the following in your `lighttpd.conf`:
   31: 
   32:     # ldap authentication
   33:     auth.backend               = "ldap"
   34:     
   35:     auth.backend.ldap.hostname = "grimnismal.local"
   36:     auth.backend.ldap.base-dn  = "dc=grimnismal,dc=local"
   37:     auth.backend.ldap.filter   = "(uid=$)"
   38:     
   39:     auth.backend.ldap.bind-dn  = "cn=Manager,dc=grimnismal,dc=local"
   40:     
   41:     # passwd for bind-dn, separated for security reasons
   42:     # contains: auth.backend.ldap.bind-pw  = "your-password"
   43:     # It must NOT be world readable!
   44:     #
   45:     include "ldapsecret"
   46:     
   47:     auth.require               = ( "/server-status" =>
   48:                                    (
   49:                                      "method"  => "basic",
   50:                                      "realm"   => "Admin only page",
   51:                                      "require" => "user=replaced"
   52:                                    ),
   53:                                    "/server-config" =>
   54:                                    (
   55:                                      "method"  => "basic",    
   56:                                      "realm"   => "Staff only page",
   57:                                      "require" => "valid-user"
   58:                                    )
   59:                                  )

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb