sudo a2enmod dav sudo a2enmod dav_fs
sudo service apache2 restartmkdir -p <Your DocumentRoot>/web chown www-data <Your DocumentRoot>/web
htpasswd -c <Your DocumentRoot>/passwd.dav <Nome_Utente>chown root:www-data <Your DocumentRoot>/passwd.dav chmod 640 <Your DocumentRoot>/passwd.dav
sudo nano /etc/apache2/sites-available/defaulte renderlo simile a quello seguente
<VirtualHost *:80>
DocumentRoot /var/www/web1/web/
<Directory /var/www/web1/web/>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Alias /webdav /var/www/web1/web
<Location /webdav>
DAV On
AuthType Basic
AuthName "webdav"
AuthUserFile /var/www/web1/passwd.dav
Require valid-user
</Location>
</VirtualHost>
Ovviamente i percorsi vanno adattati alla situazione
sudo service apache2 restartIl server WebDAV ora dovrebbe essere raggiungibile su http://site-address/webdav con le credenziali dell'utente create al punto 5
## Debian/Ubuntu quick install: sudo apt-get install libdbi-perl libdbd-sqlite3-perl libtimedate-perl libuuid-tiny-perl libxml-simple-perl libquota-perl libarchive-zip-perl \ libgraphics-magick-perl libmodule-load-perl libfile-copy-link-perl libjson-perl libdatetime-perl sudo perl -MCPAN -e "install DateTime::Format::Human::Duration" ## only for SMB backend users: sudo apt-get install libfilesys-smbclient-perl ## only for RCS backend users: sudo apt-get install librcs-perl
I seguenti pacchetti sono facoltativi ma rendono migliore l'interfaccia di WebDAV CGI:
## Debian/Ubuntu quick install: apt-get install speedy-cgi-perl ghostscript ## only for SMB backend users: apt-get install smbclient ## only for SMB and AFS backend users: apt-get install krb5-user
/etc cd /etcsudo tar jxf webdavcgi-latest.tar.gz2cd webdavcgi*sudo ./install.shrewrite a2enmod rewrite### EXAMPLE 1: a complete (virtual) server root handled by WebDAV CGI:
ScriptAlias /webdavcgi /etc/webdavcgi/cgi-bin/webdavwrapper
# ScriptAlias /logout /etc/webdavcgi/cgi-bin/logout
<Location /webdavcgi>
AuthType Basic
AuthName "WebDAV/CalDAV/CardDAV space"
AuthUserFile /path-to-my-auth-file
Require valid-user
</Location>
RewriteEngine On
# RewriteRule /logout - [L]
RewriteRule ^/ /webdavcgi [PT,E=WEBDAVCONF:/etc/webdav.conf,E=PERLLIB:/etc/webdavcgi/lib/perl,L]
### EXAMPLE 2: a virtual path /webdav
ScriptAlias /webdavcgi /etc/webdavcgi/cgi-bin/webdavwrapper
# ScriptAlias /webdav/logout /etc/webdavcgi/cgi-bin/logout
<Location /webdavcgi>
AuthType Basic
AuthName "WebDAV space"
AuthUserFile /path-to-my-auth-file
Require valid-user
</Location>
# if you want to map this to a real path, do that:
# (end setup $VIRTUAL_BASE='/webdav/?' and $DOCUMENT_ROOT in your WebDAV CGI config)
RewriteEngine On
# RewriteRule ^/webdav/logout - [L]
RewriteRule ^/webdav /webdavcgi [PT,E=WEBDAVCONF:/etc/webdav.conf,E=PERLLIB:/etc/webdavcgi/lib/perl,L]
### EXAMPLE 3: a .htaccess file to handle a complete folder with WebDAV CGI: ### Prerequisites: /webdavcgi is a script alias ## (ScriptAlias /webdavcgi /etc/webdavcgi/cgi-bin/webdavwrapper) and ### 'AllowOverride AuthConfig FileInfo' is set for the current folder RewriteEngine On RewriteRule .* /webdavcgi [E=WEBDAVCONF:/etc/webdav.conf,E=PERLLIB:/etc/webdavcgi/lib/perl] AuthType Basic AuthName "A protected WebDAV folder" AuthUserFile /path-to-my-auth-file Require valid-user
| Argomento | Sito |
|---|---|
| Preparazione Apache con WebDAV | http://www.qazxdr.com/setting-up-webdav-server-on-ubuntu-12-04/ |
| Installazione WebDAV CGI | http://webdavcgi.sourceforge.net/doc.html#installation http://webdavcgi.sourceforge.net/doc.html#setup |