Annotation of wikisrc/tutorials/lighttpd_on_netbsd.mdwn, revision 1.5

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

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