Apache2 and PHP5

From SaruWiki
Revision as of 23:24, 14 February 2009 by Saruman! (talk | contribs) (Started dav/ldap section)
Jump to navigation Jump to search

Apache2

Installation of Apache2

Contribution needed.

Configuration of Apache2

Once Apache2 is in place, you might want to enable SSL for it.

Installation of PHP5

Contribution needed.

Adding WebDAV to your Apache2

Out of the box, your Debian Apache2 is prepared to start using WebDAV. All you need is to enable two modules: one for WebDAV itself, one for the authentication that you want to use. Since our server mainly uses LDAP, we'll describe WebDAV+LDAP here.

First, enable the WebDAV and authnz_ldap modules:

a2enmod dav
a2enmod dav_fs
a2enmod authnz_ldap

Do not restart Apache2 just yet, because we haven't configured either the WebDAV site or its authentication!

Next, adapt the virtual host that may employ WebDAV and LDAP authentication. The virtual host file needs a section that enables WebDAV (using the directive Dav On), and some directives on how to authorize users within this section. Suppose we want to enable WebDAV only for subdirectory webdav within virtual host http://www.saruman.biz/. Then in the correspondig Virtual Host file (something like /etc/apache2/sites-available/000-saruman.biz) we need to include the following section:

DavLockDB /var/run/apache2.DavLock 

<Location /webdav>
   Order Allow,Deny
   Allow from all
   Dav On


   AuthType Basic
   AuthBasicProvider ldap
   AuthzLDAPAuthoritative Off
       AuthName "Saruman.BIZ"
   AuthLDAPURL "ldap://myserver.my.domain.com/ou=it,ou=departments,dc=my,dc=domain,dc=com?sAMAccountName"
   AuthLDAPBindDN "myusername@my.domain.com"
   AuthLDAPBindPassword "mypassword"
   require valid-user
</Location>