File:  [NetBSD Developer Wiki] / wikisrc / tutorials / lighttpd_on_netbsd.mdwn
Revision 1.6: download - view: text, annotated - select for diffs
Mon Nov 30 20:23:33 2020 UTC (10 months, 2 weeks ago) by schmonz
Branches: MAIN
CVS tags: HEAD
lighttpd event-handler is kqueue already by default. Document when to
set kqueue for stat-cache-engine. Agreed by gps on #lighttpd.

    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`.
   18: 
   19: 
   20: ## Configuration
   21: 
   22: If using `mod_webdav`, consider setting
   23: 
   24:     server.stat-cache-engine = "kqueue"
   25: 
   26: 
   27: ## Testing the setup
   28: 
   29: You can start the webserver with:
   30: 
   31:     /etc/rc.d/lighttpd start
   32: 
   33: Check your logs if you encounter any problem.
   34: 
   35: 
   36: ## Adding LDAP authentication
   37: 
   38: We will use OpenLdap.
   39: 
   40: 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]].
   41: 
   42: Be sure to load `mod_auth` and include the following in your `lighttpd.conf`:
   43: 
   44:     # ldap authentication
   45:     auth.backend               = "ldap"
   46:     
   47:     auth.backend.ldap.hostname = "grimnismal.local"
   48:     auth.backend.ldap.base-dn  = "dc=grimnismal,dc=local"
   49:     auth.backend.ldap.filter   = "(uid=$)"
   50:     
   51:     auth.backend.ldap.bind-dn  = "cn=Manager,dc=grimnismal,dc=local"
   52:     
   53:     # passwd for bind-dn, separated for security reasons
   54:     # contains: auth.backend.ldap.bind-pw  = "your-password"
   55:     # It must NOT be world readable!
   56:     #
   57:     include "ldapsecret"
   58:     
   59:     auth.require               = ( "/server-status" =>
   60:                                    (
   61:                                      "method"  => "basic",
   62:                                      "realm"   => "Admin only page",
   63:                                      "require" => "user=replaced"
   64:                                    ),
   65:                                    "/server-config" =>
   66:                                    (
   67:                                      "method"  => "basic",    
   68:                                      "realm"   => "Staff only page",
   69:                                      "require" => "valid-user"
   70:                                    )
   71:                                  )

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