| 1 | = Installation of DAVAdmin = |
|---|
| 2 | |
|---|
| 3 | To install DAVAdmin you need: |
|---|
| 4 | |
|---|
| 5 | * an Apache 2.2 webserver http://httpd.apache.org/ |
|---|
| 6 | * mod_auth_digest |
|---|
| 7 | * mod_dav |
|---|
| 8 | * mod_env |
|---|
| 9 | * mod_auth_file |
|---|
| 10 | * mod_authz_groupfile |
|---|
| 11 | * administration privileges for the webserver or a cooperative ISP |
|---|
| 12 | * shell access to create administration users for you DAVAdmin installation |
|---|
| 13 | * for site installation you need write access to a globally available directory on the webserver host (i.e. /usr/local) |
|---|
| 14 | * installed [http://www.smarty.net/ Smarty template engine] available for PHP as `smarty` in the php include, on Debian just install the smarty package. |
|---|
| 15 | |
|---|
| 16 | == DAVAdmin installation == |
|---|
| 17 | |
|---|
| 18 | Download the release file from the [wiki:Downloads downloads page]. |
|---|
| 19 | |
|---|
| 20 | Extract the release file in a directory |
|---|
| 21 | |
|---|
| 22 | {{{ |
|---|
| 23 | cd /usr/local |
|---|
| 24 | tar xzf davadmin-0.2.tar.gz |
|---|
| 25 | }}} |
|---|
| 26 | |
|---|
| 27 | == Apache Setup == |
|---|
| 28 | |
|---|
| 29 | The following apache configuration file snippet shows the configuration of a !VirtualHost to use WebDAV for a directory {{{dav}}} inside the !VirtualHost's document root: |
|---|
| 30 | |
|---|
| 31 | {{{ |
|---|
| 32 | <VirtualHost 127.0.0.1:80> |
|---|
| 33 | ServerAdmin jan@davhost.example.com |
|---|
| 34 | ServerName dav.localhost |
|---|
| 35 | |
|---|
| 36 | DavLockDb /var/run/apache2/davlock/davhost.example.com |
|---|
| 37 | DocumentRoot /var/www/html |
|---|
| 38 | Alias /davadmin /usr/local/davadmin-0.2/admin |
|---|
| 39 | |
|---|
| 40 | php_admin_value allow_call_time_pass_reference 1 |
|---|
| 41 | <Directory /var/www/html/dav> |
|---|
| 42 | Dav on |
|---|
| 43 | AllowOverride AuthConfig Indexes |
|---|
| 44 | Order Allow,Deny |
|---|
| 45 | allow from all |
|---|
| 46 | |
|---|
| 47 | AuthType Digest |
|---|
| 48 | AuthName "WebDAV on davhost.example.com" |
|---|
| 49 | AuthDigestDomain /dav/ |
|---|
| 50 | |
|---|
| 51 | AuthDigestProvider file |
|---|
| 52 | AuthUserFile /var/www/auth/dav.htdigest |
|---|
| 53 | AuthGroupFile /var/www/auth/dav.groups |
|---|
| 54 | |
|---|
| 55 | require valid-user |
|---|
| 56 | </Directory> |
|---|
| 57 | |
|---|
| 58 | <Location /davadmin> |
|---|
| 59 | AuthType Digest |
|---|
| 60 | AuthName "WebDAV Administration" |
|---|
| 61 | AuthDigestDomain /davadmin http://davhost.example.com/davadmin |
|---|
| 62 | |
|---|
| 63 | SetEnv DavAdminConfDir /var/www/conf |
|---|
| 64 | |
|---|
| 65 | AuthDigestProvider file |
|---|
| 66 | AuthUserFile /var/www/auth/davadmin.htdigest |
|---|
| 67 | require valid-user |
|---|
| 68 | </Location> |
|---|
| 69 | |
|---|
| 70 | ErrorLog /var/log/apache2/davhost.example.com_error.log |
|---|
| 71 | LogLevel warn |
|---|
| 72 | CustomLog /var/log/apache2/davhost.example.com_access.log combined |
|---|
| 73 | </VirtualHost> |
|---|
| 74 | }}} |
|---|
| 75 | |
|---|
| 76 | The snippet is included in the release file as {{{davadmin.vhost}}} inside the directory {{{setup}}}. You will want to change the IP address, directory names, realm names ({{{AuthName}}} directive), and other settings relevant for your site. |
|---|
| 77 | |
|---|
| 78 | All following instructions refer to the information used in the above configuration snippet. You need to make sure that you have write access to the used files or have a friendly administrator at hand who performs the tasks for you. |
|---|
| 79 | |
|---|
| 80 | === Creating necessary files and directories === |
|---|
| 81 | |
|---|
| 82 | {{{ |
|---|
| 83 | mkdir -p /var/www/auth |
|---|
| 84 | mkdir -p /var/www/html/dav |
|---|
| 85 | mkdir -p /var/www/conf |
|---|
| 86 | touch /var/www/auth/dav.htdigest |
|---|
| 87 | touch /var/www/auth/dav.groups |
|---|
| 88 | touch /var/www/auth/dav.namemap |
|---|
| 89 | }}} |
|---|
| 90 | |
|---|
| 91 | === Granting neccessary write access to the apache user === |
|---|
| 92 | In the following lines we assume your apache user is {{{www-data}}} ([http://www.debian.org/ Debian's] default). Consult your operating system manual to find out what is the correct username for your system. |
|---|
| 93 | |
|---|
| 94 | == Creation of DAVAdmin users == |
|---|
| 95 | To add DAVAdmin users you need to create the authentication file using Apache's {{{htdigest}}} tool. |
|---|
| 96 | |
|---|
| 97 | {{{ |
|---|
| 98 | htdigest -c /var/www/auth/davadmin.htdigest "WebDAV Administration" admin |
|---|
| 99 | }}} |
|---|
| 100 | |
|---|
| 101 | The tool asks you for the password for the user admin and a confirmation of the password. |
|---|
| 102 | |
|---|
| 103 | ==== Using ACLs ==== |
|---|
| 104 | If you have an ACL enabled file system you may use the following instructions to grant the necessary rights. |
|---|
| 105 | |
|---|
| 106 | * grant write access to the WebDAV root: |
|---|
| 107 | {{{ |
|---|
| 108 | setfacl -d -m u:www-data:rwx /var/www/html/dav |
|---|
| 109 | setfacl -m u:www-data:rwx /var/www/html/dav |
|---|
| 110 | }}} |
|---|
| 111 | |
|---|
| 112 | * grant write access to the authentication and authorization files |
|---|
| 113 | {{{ |
|---|
| 114 | setfacl -m u:www-data:rw- /var/www/auth/dav.htdigest /var/www/auth/dav.groups /var/www/auth/dav.namemap |
|---|
| 115 | }}} |
|---|
| 116 | |
|---|
| 117 | ==== Without using ACLs ==== |
|---|
| 118 | If you cannot use ACLs you have two options: |
|---|
| 119 | |
|---|
| 120 | * making the directories and files world writable |
|---|
| 121 | {{{ |
|---|
| 122 | chmod 0777 /var/www/html/dav |
|---|
| 123 | chmod 0666 /var/www/auth/dav.htdigest /var/www/auth/dav.groups /var/www/auth/dav.namemap |
|---|
| 124 | }}} |
|---|
| 125 | |
|---|
| 126 | * changing the owner of the files to the apache user |
|---|
| 127 | {{{ |
|---|
| 128 | chown www-data /var/www/html/dav |
|---|
| 129 | chown www-data /var/www/auth/dav.htdigest /var/www/auth/dav.groups /var/www/auth/dav.namemap |
|---|
| 130 | }}} |
|---|
| 131 | |
|---|
| 132 | == DAVAdmin configuration == |
|---|
| 133 | |
|---|
| 134 | DAVAdmin is configured via a file {{{config.inc.php}}} in the directory defined via the {{{SetEnv DavAdminConfDir}}} directive in the apache configuration. For the above setup the configuration file has the following content: |
|---|
| 135 | |
|---|
| 136 | {{{ |
|---|
| 137 | <?php |
|---|
| 138 | /* |
|---|
| 139 | * DavAdmin configuration file. |
|---|
| 140 | */ |
|---|
| 141 | |
|---|
| 142 | $davconfig = array( |
|---|
| 143 | 'compile_dir' => '/var/www/templates_c', |
|---|
| 144 | 'digest.file' => '/var/www/auth/dav.htdigest', |
|---|
| 145 | 'group.file' => '/var/www/auth/dav.groups', |
|---|
| 146 | 'namemap.file' => '/var/www/auth/dav.namemap', |
|---|
| 147 | 'dav.dir' => '/var/www/html/dav', |
|---|
| 148 | 'dav.realm' => 'WebDAV on davhost.example.com', |
|---|
| 149 | 'dav.uri' => 'http://davhost.example.com/dav/', |
|---|
| 150 | ); |
|---|
| 151 | ?> |
|---|
| 152 | }}} |
|---|
| 153 | |
|---|
| 154 | == Restart apache == |
|---|
| 155 | |
|---|
| 156 | To make the setup active you need to restart your apache webserver. On a Debian system with {{{sudo}}} use: |
|---|
| 157 | |
|---|
| 158 | {{{ |
|---|
| 159 | sudo invoke-rc.d apache2 restart |
|---|
| 160 | }}} |
|---|
| 161 | |
|---|
| 162 | For other systems please read the manuals on how to restart the apache webserver. |
|---|