Apache2 and PHP5: Difference between revisions

From SaruWiki
Jump to navigation Jump to search
m (Page started)
 
(Started dav/ldap section)
Line 1: Line 1:
==Apache2 and PHP5==
==Apache2==


===Installation of Apache2===
===Installation of Apache2===
Line 7: Line 7:
Once Apache2 is in place, you might want to [[Enabling SSL for Apache2 | enable SSL]] for it.
Once Apache2 is in place, you might want to [[Enabling SSL for Apache2 | enable SSL]] for it.


===Installation of PHP5===
==Installation of PHP5==
Contribution needed.
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 ''<nowiki>http://www.saruman.biz/</nowiki>''. 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>

Revision as of 22:24, 14 February 2009

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>