File:  [NetBSD Developer Wiki] / wikisrc / tutorials / lighttpd_on_netbsd.mdwn
Revision 1.3: download - view: text, annotated - select for diffs
Mon Nov 30 18:46:30 2020 UTC (10 months, 2 weeks ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by schmonz: Remove more unneeded manual steps

    1: **Contents**
    2: 
    3: [[!toc]]
    4: 
    5: ##  Prelude 
    6: 
    7: How to deploy a high performance webserver using NetBSD and Lighttpd. 
    8: 
    9: ##  Installation 
   10: 
   11: Via `pkgin` or `pkg_add` for platforms with binary packages available, or via pkgsrc thus: 
   12:     
   13:     $ cd /usr/pkgsrc/www/lighttpd
   14:     $ make install clean clean-depends
   15: 
   16: 
   17: If you don’t have `PKG_RCD_SCRIPTS=yes` set, manually install the provided rc.d script:
   18:     
   19:     # cp /usr/pkg/share/examples/rc.d/lighttpd /etc/rc.d
   20: 
   21: And set `lighttpd=YES` in `/etc/rc.conf`.
   22:     
   23: 
   24: ##  Configuration     
   25: 
   26: Enable kqueue: 
   27:     
   28:     server.event-handler        = "kqueue"    
   29:     server.stat-cache-engine    = "kqueue"
   30:     
   31: 
   32: ##  Testing the setup 
   33: 
   34: You can start the webserver with: 
   35:     
   36:     /etc/rc.d/lighttpd start
   37:     
   38: 
   39: Check your logs if you encounter any problem. 
   40: 
   41: ##  Setting up authentication 
   42: 
   43: ###  Directory server 
   44: 
   45: We will use OpenLdap. 
   46: 
   47: 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]]. 
   48: 
   49: Be sure to load mod_auth and include the following in your lighttpd.conf file: 
   50:     
   51:     
   52:     # ldap authentication
   53:     auth.backend               = "ldap"
   54:      
   55:     auth.backend.ldap.hostname = "grimnismal.local"
   56:     auth.backend.ldap.base-dn  = "dc=grimnismal,dc=local"
   57:     auth.backend.ldap.filter   = "(uid=$)"
   58:      
   59:     auth.backend.ldap.bind-dn  = "cn=Manager,dc=grimnismal,dc=local"
   60:     
   61:     # passwd for bind-dn, separated for security reasons
   62:     # contains: auth.backend.ldap.bind-pw  = "your-password"
   63:     # It must NOT be world readable!
   64:     #
   65:     include "ldapsecret"
   66:      
   67:     auth.require               = ( "/server-status" =>
   68:                                    (
   69:                                      "method"  => "basic",
   70:                                      "realm"   => "Admin only page",
   71:                                      "require" => "user=replaced"
   72:                                    ),
   73:                                    "/server-config" =>
   74:                                    (
   75:                                      "method"  => "basic",      
   76:                                      "realm"   => "Staff only page",
   77:                                      "require" => "valid-user"  
   78:                                    )
   79:                                  )
   80:     
   81: 

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