mod_fcgid
, see ConfiguringWebDAVContribWithFCGI.
/var/www/wiki/tools/WebDAVContrib_mod_perl_startup.pl
with the
following content:
use ModPerl::RegistryLoader; use lib '/var/www/wiki/bin'; do 'setlib.cfg'; 1;
This tells WebDAVContrib where you want to run Foswiki from.
.htaccess
)
This exposes the /dav
path on your server. You can change this location
to whatever you want, but make sure the FoswikiLocation
matches it.
PerlRequire "/var/www/wiki/tools/WebDAVContrib_mod_perl_startup.pl" PerlLoadModule Apache::FoswikiDAVHandler <Location "/dav"> SetHandler perl-script FoswikiLocation "/dav" FoswikiFilesysHandler Filesys::Virtual::Foswiki PerlHandler Apache::FoswikiDAVHandler </Location>This will configure DAV without authentication, so all transactions will use the "guest" login. See "Configuring authentication" below for information on configuring web server authentication.
Restart your apache server.
The path http://wiki.alexander-weimer.com/dav should now show you all your root webs, when viewed from a DAV-enabled client.cadaver
(available for most platforms
- you can get a Windows version from
http://www.phtagr.org/2009/04/01/cadaver-for-windows/ **).
Run cadaver
and open the DAV folder on the server:
dav:!> open http://wiki.alexander-weimer.com/dav dav:/dav/> ls Listing collection `/dav/': succeeded. Coll: Main 4096 Mar 25 12:42 Coll: Sandbox 4096 Apr 6 08:19 Coll: System 20480 Apr 7 10:32 … dav:/dav/> cd Sandbox dav:/dav/> put packages.txt LoremIpsum.txt Progress: [===================>] 100.0% of 320 bytes succeeded dav:/dav/> cat LoremIpsum.txt Displaying `/dav/Sandbox/LoremIpsum.txt': Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum…. dav:/dav/> cd LoremIpsum_files dav:/dav/> put muspimerol.gif Progress: [===================>] 100.0% of 2800 bytes succeeded dav:/dav/> ls Listing collection `//dav/Sandbox/LoremIpsum_files/': succeeded. muspimerol.gif 2800 Apr 12 14:38If cadaver reports any errors, check your apache error log on the server. You can verify that the LoremIpsum topic has been created by going to https://wiki.alexander-weimer.com/bin/view/Sandbox/LoremIpsum.
user="BaseUserMapping_666"
shows that the creation of the LoremIpsum topic and the subsequent uploading of the muspimerol.gif
attachment was done using the WikiGuest user. If you try to do the same in the System directory, you will get a failure response:
dav:!> open http://wiki.alexander-weimer.com/dav dav:/dav/> cd Sandbox dav:/dav/> put packages.txt LoremIpsum.txt Uploading packages.txt to `/dav/System/LoremIpsum.txt': Progress: [=============================>] 100.0% of 320 bytes failed: 401 Authorization Required
(At this point attempting to access the WebFolder using Windows XP service pack 2 allows you to browse the folders, but opening any files will fail)
PerlRequire "/var/www/wiki/tools/WebDAVContrib_mod_perl_startup.pl"
PerlLoadModule Apache::FoswikiDAVHandler
<Location "/dav">
SetHandler perl-script
FoswikiLocation "/dav"
FoswikiFilesysHandler Filesys::Virtual::Foswiki
FoswikiDebug 0
PerlHandler Apache::FoswikiDAVHandler
AuthName "Foswiki"
AuthUserFile /var/www/wiki/data/.htpasswd
AuthType Basic
<LimitExcept OPTIONS>
require valid-user
</LimitExcept>
</Location>
Restart the web server after any change to the Apache configuration.
(Note that OPTIONS requests are excluded from authentication because of a bug in Windows WebDAV, which doesn't send authentication headers with OPTIONS requests. This is not a significant security risk, as OPTIONS only tells the client what the server's capabilities are.)
C:\Documents and Settings\Administrator\Desktop\cadaver>cadaver.bat dav:!> open http://wiki.alexander-weimer.com/dav Authentication required for Foswiki on server `wiki.alexander-weimer.com': Username: BillGates Password: dav:/dav/> ls Listing collection `//dav/': succeeded. Coll: Main 4096 Feb 24 07:14 Coll: Sandbox 4096 Apr 10 00:51 Coll: System 24576 Apr 9 09:01 …
Note that Basic Authentication is much more secure if used over SSL (with https: URLs).
FoswikiDebug
Apache
directive. See WebDAVContrib for more information.