Welcome! Log In Create A New Profile

Advanced

WebDAV

Posted by frozenrhino 
WebDAV
December 28, 2010 10:25PM
Evening, all.

Have any of you had luck getting webdav going under Squeeze?

I gave it a go using these instructions, but something is amiss.

I can see the passwd.dav file just hitting https://myserveraddy and it doesn't ask for a password unless I explicitly add on /webdav to the URL.

If anyone has any suggestions (other than distilled spirits), please advise.

Thanks,

FZR
Re: WebDAV
December 29, 2010 10:54AM
Haven't tried it but the following link looks interesting:
http://www.howtoforge.com/setting-up-webdav-with-lighttpd-debian-etch

In theory lighttpd might be lighter on resources than apache.

-PG
Re: WebDAV
December 29, 2010 06:38PM
So I found this:

http://bernaerts.dyndns.org/linux/62-debian-webdav-share

And if you can excuse a couple of really heinous gaffes in the walkthrough, it actually does work. It's kind of slick to see, actually. A friend reports that it is wonderful using NetDrive under Win7.

Now if Cyberduck will get their bugs fixed so I can use it from OS X rather than the native connection (which is less than lovely).

Anyway, you know better than to put your password file out there in the shared directory I'm sure and you know to do all of the commands as sudo.
I'm guessing that the author was writing for an experienced audience.

I've yet to use lighttpd. I went with Apache2 on this install just because that's what I know best (and that's not saying much).

All the best,

FZR
Re: WebDAV
December 30, 2010 04:35PM
Yes, lighttpd is great on my dockstar. Be sure to have a look at PMWiki, too (http://www.pmwiki.org/).

This is what I did to set up Lighttpd, Php, Webdav:

	The following assumes that
		myaccount is your username
		webdav.mydomain.local is your dockstar in your local (non-internet) domain 
		mydomain.dyndns.org is your dynamic domain, which points to your internet router regardless of the actual servername used

	Credits
		http://www.howtoforge.de/howto/wie-man-webdav-mit-lighttpd-auf-debian-etch-konfiguriert/
		http://www.mikrocontroller.net/articles/DockstarDebianSqueeze#Lighttpd.2C_Php.2C_Webdav
		http://www.asconix.com/howtos/debian/lighttpd-ssl-howto
		http://www.howtoforge.de/howto/howto-selbstsigniertes-ssl-zertifikat-erstellen/1
		https://help.ubuntu.com/community/OpenSSL
		
	apt-get install lighttpd lighttpd-mod-webdav php5-cgi php5-xcache apache2-utils
	mkdir /var/run/lighttpd/
	chown www-data:www-data /var/run/lighttpd/
	lighty-enable-mod auth ssl webdav fastcgi fastcgi-php 
	cd /var/www
	mkdir -p web1/www 		# normal pages and PMWiki go here
	mv index.lighttpd.html web1/www # just for a quick test
	mkdir -p web2/webdav	# webdav files go here
	chown -R www-data:www-data *
	htpasswd -c /var/www/web2/webdav/passwd.dav myaccount
	chown root:www-data /var/www/web2/webdav/passwd.dav
	chmod 640 /var/www/web2/webdav/passwd.dav
	nano /etc/lighttpd/conf-available/10-webdav.conf  # add the following:
		$HTTP["host"] =~ "webdav(\.mydomain\.(dyndns\.org)|(local))*" {
			server.document-root = "/var/www/web2/webdav"
			webdav.activate = "enable"
			webdav.is-readonly = "disable"
			auth.backend = "htpasswd"
			auth.backend.htpasswd.userfile = "/var/www/web2/webdav/passwd.dav"
			auth.require = ( "" => ( "method" => "basic",
				"realm" => "webdav",
				"require" => "valid-user" ) )
		}
	Set up SSL certificates for
		*.mydomain.local
		*.mydomain.dyndns.org
		(see elsewhere for details)
		copy the two resulting .pem files to /etc/ssl/private/ 
	nano /etc/lighttpd/conf-available/10-ssl.conf # change:
		$SERVER["socket"] == "0.0.0.0:443" {
			ssl.engine  = "enable"
			ssl.pemfile = "/etc/ssl/private/mydomain.local-server_key_crt.pem"
			$HTTP["host"] =~ "\.dyndns\.org" {
				ssl.pemfile = "/etc/ssl/private/mydomain.dyndns.org-server_key_crt.pem"
			}
		}

	/etc/init.d/lighttpd restart
	
	Setup up your internet router so an arbitrary port above 50000 (say, 54321) is forwarded to your dockstar's ssl port, 
	e.g. to 192.168.0.26:443

	You should now be able to contact your webdav server locally e.g.
		cadaver http://webdav.mydomain.local
	or from the outside
		https://webdav.mydomain.dyndns.org:54321

Yes, this is dense -- more kind of a copy/paste template than a walkthrough... HTH though.

Regards,
Heinz
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: