Welcome! Log In Create A New Profile

Advanced

My quest for a perfect WebDAV server on GoFlex Net that works with KDE Dolphin and iPad2 (or how to setup lighttpd WebDAV with SSL)

Posted by Vlad 
Since I spent something like two last weeks to get this working, I guess it would be nice to share my experience. My goal was to set up a WebDAV server with SSL (self signed cert) and three accounts at different locations. 
  • "ebooks"-account for my ebook library which I want to access on my iPad via GoodReader. The account folder should be located on a SATA HDD connected to my GoFlex Net
  • "files"-account for sharing data between my Kubuntu laptop and the iPad. The account folder should be located on a 16 GB USB flash drive connected to my GoFlex Net
  • "service"-account for accessing rootfs backups and scheduled downloads. The account folder should be located on a 16 GB USB flash drive connected to my GoFlex Net too.

My first idea was to use Apache 2.2 from the Debian Squeeze repos and it wasn't particulary difficult to get it running with SSL and digest authentification. As far as the iPad is concerned, I bought iFiles on the App Store which worked well too. The troubles actually began when I started to studying the Apache error.log. Firstly, I learned that every time I accessed or created a file via iFiles, Apache gave me a "file does not exist" error like
[Sun Jul 31 16:45:57 2011] [error] [client 192.168.1.24] File does not exist: /media/HDD/files/test.txt
Secondly, when I did the same via Dolphin (Kubuntu's standard file manager) , I got the "password mismatch" error
[Mon Aug 01 00:28:49 2011] [error] [client 192.168.1.39] Digest: user files: password mismatch: /files/
The funny thing is that despite the errors everything seemed to work just fine. I tried googling those errors and found quite many similar problem descriptions but no solutions. Then I learned that when using SSL you don't really need the digest auth, since SSL makes sure that the whole communication is encrypted and so I switched to the basic auth. That made the "password mismatch errors" go away and so I was quite happy until I tried uploading big files  (like 180 MB) to my WebDAV server via Dolphin. This time I got the "could not  get next bucket brigade [500, #0]" error.
[Tue Aug 23 16:24:15 2011] [error] [client 192.168.1.39] Could not get next bucket brigade (URI: /files/arc.zip)  [500, #0]
The bad thing is that this error wasn't as harmless as the previous ones and indeed caused the upload to fail. After some experiments I found out that the error didn't occur when uploading smaller files (even 50MB were still fine) or when turning SSL off. I even tried installing a newer apache version from Debian Wheezy but that didn't solve the problem  either. Finally, being completely pissed off with Apache, I decided to give lighttpd a chance. To be honest, using digest auth and SSL gave me the password mismatch error even when using   lighttpd, so I suspect that it might be a solely KDE problem. However, when using basic auth and SSl everything worked great and I had absolutely no problems uploading large files. So far so good. Just as I managed to solve my Dolphin-related problems, I got new problems with iFiles. For some reason it refused to play nicely with lighttpd, displaying only half of the files in a WebDAV folder and duplicating certain folders. So I decided to try something else and found a wonderful app called WebDAV Navigator. The best thing is that it can do pretty much the same as iFiles but is completely free. The only thing I'm missing is the ability to edit text files which is present in iFiles but apart from that WebDAV Navigator is really great. It correctly displays the content of my WebDAV folders and allows me to easily upload or download files. 

Now I'm finally going to describe my WebDAV setup in a form of a Howto.
We begin by installing the neccesary packages (as root)
apt-get install lighttpd lighttpd-mod-webdav apache2-utils openssl 
lighttpd-enable-mod auth webdav
Now we should create the folders for the webdav accounts. Those usually should be located
at /var/www but via symlinks we can put them everywhere we want. My folders are located at
/media/HDD/service, /media/HDD/ebooks and /media/USB/files. Thus symlink those to /var/www
ln -s /media/HDD/service /var/www/service
ln -s /media/HDD/ebooks /var/www/ebooks
ln -s /media/USB/files /var/www/files
We also have to make sure, that all webdav folders are always owned by www-data.
chown -R www-data:www-data /media/HDD/service
chown -R www-data:www-data /media/HDD/ebooks
chown -R www-data:www-data /media/USB/files
chown -R www-data:www-data /var/www/service
chown -R www-data:www-data /var/www/ebooks
chown -R www-data:www-data /var/www/files
Now we create the users for the accounts and make the auth file accessible only for lighttpd and root
htpasswd -c /etc/lighttpd/dav_auth service_user
-> Password
htpasswd /etc/lighttpd/dav_auth ebooks_user
-> Password
htpasswd /etc/lighttpd/dav_auth files_user
chown root:www-data /etc/lighttpd/dav_auth
chmod 640 /etc/lighttpd/dav_auth
Finally, let's add the WebDAV accounts to the lighttpd config:
nano /etc/lighttpd/conf-enabled/10-webdav.conf
$HTTP["url"] =~ "^/service($|/)" {
                 webdav.activate = "enable"
                 webdav.is-readonly = "disable"
                 auth.backend = "htpasswd"
                 auth.backend.htpasswd.userfile = "/etc/lighttpd/dav_auth"
                 auth.require = ( "" => ( "method" => "basic",
                         "realm" => "webdav_service",
                         "require" => "user=service_user" ) )
                 }

 $HTTP["url"] =~ "^/ebooks($|/)" {
                 webdav.activate = "enable"
                 webdav.is-readonly = "disable"
                 auth.backend = "htpasswd"
                 auth.backend.htpasswd.userfile = "/etc/lighttpd/dav_auth"
                 auth.require = ( "" => ( "method" => "basic",
                         "realm" => "webdav_ebooks",
                         "require" => "user=ebooks_user" ) )
                 }


    $HTTP["url"] =~ "^/files($|/)" {
                 webdav.activate = "enable"
                 webdav.is-readonly = "disable"
                 auth.backend = "htpasswd"
                 auth.backend.htpasswd.userfile = "/etc/lighttpd/dav_auth"
                 auth.require = ( "" => ( "method" => "basic",
                         "realm" => "webdav_files",
                         "require" => "user=files_user" ) )

                 }

Via the
"require" => "user=<username>"
directive we make sure each user is allowed to login only into his own account. If you want to allow every user to login into any account, replace "user=<username>" by "valid-user"
Use Ctrl+O, Ctrl+X to save the file and quit nano.
Restart lighttpd
/etc/init.d/lighttpd restart
and try to access http://goflex-ip/files. For KDE Dolphin use webdav://goflex-ip/files
If you get errors, you should edit lighttpd.conf
nano /etc/lighttpd/lighttpd.conf
and add this
debug.log-request-header     = "enable"
debug.log-response-header    = "enable"
debug.log-request-handling   = "enable"
debug.log-file-not-found     = "enable"
debug.log-condition-handling = "enable"
in order to make lighttpd's log files more informative. The log file is located at /var/log/lighttpd/error.log. Use less to study it carefully
less /var/log/lighttpd/error.log
and find out what's going wrong.

If everything works fine, we can go to the SSL part. First, we enable the SSL module
lighttpd-enable-mod ssl
Now we need to create a self-signed SSL certificate. Here I'm basically using this guide
cd /etc/lighttpd
openssl req -config /etc/ssl/openssl.cnf -new -out server.csr
Note the PEM passphrase and challenge password since you'll need them afterwards. Things like Country name, Province Name, Locality Name, Organization Name, Organization Unit Name,Email Address and An optional company name are not really important, so you can supply everything you want. What is important is the Common Name, since it should match the name of your lighttpd-site. For instance, in my /etc/hostname I have
mygoflex
and in my /etc/hosts
192.168.1.56    mygoflex.mynet.com mygoflex
where 192.168.1.56 is the static IP of mygoflex. I also can succesfully ping mygoflex.mynet.com from my Kubuntu laptop. Thus, as a common name I should supply
mygoflex.mynet.com
After that we run
openssl rsa -in privkey.pem -out server.key
and enter the PEM passphrase
Then we create our self-signed certificate (server.crt) with 3650 days validity time
openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650
For lighttpd we need a so called pem, which can be created by issuing
cat server.crt server.key > server.pem
Next we restart lighttpd
/etc/init.d/lighttpd restart
and enjoy the result:
https://goflex-ip/files (Web browser)
webdavs://goflex-ip/files (KDE Dolphin)
Both KDE Dolphin and Firefox complain about unverified certificate, which is correct, since your cert is a self signed one and doesn't come from a Certificate authority. Just tell your programms to accept the certficiate and you're done.
As far as the iPad is concerned, you must import you certificate to make iOS accept the SSL connection. To do this, copy
/etc/lighttpd/server.crt to you PC and e-Mail the file to our iPad. After you click on server.crt in the Mail-App iOS will propose you to import the certificate which you should do. Ignore all warnings. If the certificate has been imported correctly, you should be able to navigate https://mygoflex.mynet.com/files in mobile Safari without any warnings. Now you can configure you apps and enjoy your personal WebDAV. Personally, I recommend using WebDAV Navigator and GoodReader (for accessing ebooks) but of course you are free to use whatever you want, as long as those apps support WebDAV and play nicely with lighttpd.

PS Of course you should replace goflex-ip by the IP of your device!
PPS If you want to keep your server.pem in a different place than /etc/lighttpd, just put the correct path to
/etc/lighttpd/conf-enabled/10-ssl.conf
Edit: I got a strange mail from cron, complaining about /etc/cron.daily/lighttpd:
su: Authentication failure
(ignored)
su: Authentication failure
(ignored)
The solution was to add www-data to /etc/shadow:
www-data:*:15210:0:99999:7:::



Edited 5 time(s). Last edit at 09/24/2011 07:12AM by Vlad.
Thats great! I've searched for something like this for a long time. Do you know OwnCloud? Seems pretty slick but it depends on apache. I wonder if it is possible to get OwnCloud work with lighttpd?

http://owncloud.org
Frankly speaking, I'm not really a fan of all-in-one solutions like Owncloud, but I believe some folks have already got it running on a Dockstar which means that it will also work on GoFlex Net. See here
http://forum.doozan.com/read.php?2,5454
Tried to install the packages but they dont seem to be in the respositories:

$ apt-get install lighttpd lighttpd-mod-webdav apache2-utils openssl lighttpd-enable-mod auth webdav
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package lighttpd-enable-mod
E: Unable to locate package auth
E: Unable to locate package webdav

$ uname -ra
Linux ds-debian 3.0.3-dockstar #1 Sun Aug 28 20:16:48 CEST 2011 armv5tel GNU/Linux

$ cat /etc/apt/sources.list

deb http://repo.dev-eth0.de/ squeeze main

deb http://ftp.de.debian.org/debian testing main contrib non-free

deb http://ftp.de.debian.org/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main contrib non-free

deb-src http://ftp.de.debian.org/debian/ squeeze main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free

Any suggestions?
Those should actually be two lines but somehow they got merged in the howto. I've just updated that part.
as root running /etc/cron.daily/lighttpd also gave the same authentication error, i didn't feel like mucking around with the shadow file and figured out a different way to get those cron errors to stop

passwd --lock www-data


> Edit: I got a strange mail from cron, complaining
> about /etc/cron.daily/lighttpd:
>
> su: Authentication failure
> (ignored)
> su: Authentication failure
> (ignored)
>
> The solution was to add www-data to /etc/shadow:
>
> www-data:*:15210:0:99999:7:::
@Vlad,

Thanks for the tutorial, this is great!

I followed your instruction above, and finished the 1st part. I have one user "media_user" and one top level folder /var/www/media.

$HTTP["url"] =~ "^/media($|/)" {
                 webdav.activate = "enable"
                 webdav.is-readonly = "disable"
                 auth.backend = "htpasswd"
                 auth.backend.htpasswd.userfile = "/etc/lighttpd/dav_auth"
                 auth.require = ( "" => ( "method" => "basic",
                         "realm" => "webdav_service",
                         "require" => "user=media_user" ) )
                 }

After restarting lighttpd, and tried to test it in a browser with the URL http://192.168.0.220/media, I got the login dialog, authentication was OK, and logged in as media_user. But then immediate got the "404 page not found" error.

The error log:

# cat /var/log/lighttpd/error.log 
2012-09-27 02:09:20: (log.c.166) server started 
2012-09-27 02:09:34: (request.c.306) fd: 8 request-len: 391 
GET /media/ HTTP/1.1
Host: 192.168.0.220
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
DNT: 1
Authorization: Basic bWVkaWFfdXNlcjpjYWxvY251b25ndHJ1aQ==
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: keep-alive

 
2012-09-27 02:09:34: (response.c.241) run condition 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.471) SERVER["socket"] ( :80 ) compare to  [::]:80 
2012-09-27 02:09:34: (configfile-glue.c.534) 1 (uncached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.273) 2 global/HTTPurl=~^/media($|/) nej 
2012-09-27 02:09:34: (configfile-glue.c.534) 2 (uncached) result: unknown 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.273) 2 global/HTTPurl=~^/media($|/) nej 
2012-09-27 02:09:34: (configfile-glue.c.534) 2 (uncached) result: unknown 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.273) 2 global/HTTPurl=~^/media($|/) nej 
2012-09-27 02:09:34: (configfile-glue.c.534) 2 (uncached) result: unknown 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.273) 2 global/HTTPurl=~^/media($|/) nej 
2012-09-27 02:09:34: (configfile-glue.c.534) 2 (uncached) result: unknown 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.273) 2 global/HTTPurl=~^/media($|/) nej 
2012-09-27 02:09:34: (configfile-glue.c.534) 2 (uncached) result: unknown 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.273) 2 global/HTTPurl=~^/media($|/) nej 
2012-09-27 02:09:34: (configfile-glue.c.534) 2 (uncached) result: unknown 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.273) 2 global/HTTPurl=~^/media($|/) nej 
2012-09-27 02:09:34: (configfile-glue.c.534) 2 (uncached) result: unknown 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.273) 2 global/HTTPurl=~^/media($|/) nej 
2012-09-27 02:09:34: (configfile-glue.c.534) 2 (uncached) result: unknown 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.273) 2 global/HTTPurl=~^/media($|/) nej 
2012-09-27 02:09:34: (configfile-glue.c.534) 2 (uncached) result: unknown 
2012-09-27 02:09:34: (response.c.300) -- splitting Request-URI 
2012-09-27 02:09:34: (response.c.301) Request-URI  :  /media/ 
2012-09-27 02:09:34: (response.c.302) URI-scheme   :  http 
2012-09-27 02:09:34: (response.c.303) URI-authority:  192.168.0.220 
2012-09-27 02:09:34: (response.c.304) URI-path     :  /media/ 
2012-09-27 02:09:34: (response.c.305) URI-query    :   
2012-09-27 02:09:34: (response.c.349) -- sanatising URI 
2012-09-27 02:09:34: (response.c.350) URI-path     :  /media/ 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.471) HTTP["url"] ( /media/ ) compare to  ^/media($|/) 
2012-09-27 02:09:34: (configfile-glue.c.534) 2 (uncached) result: true 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (mod_access.c.135) -- mod_access_uri_handler called 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (response.c.470) -- before doc_root 
2012-09-27 02:09:34: (response.c.471) Doc-Root     : /var/www 
2012-09-27 02:09:34: (response.c.472) Rel-Path     : /media/ 
2012-09-27 02:09:34: (response.c.473) Path         :  
2012-09-27 02:09:34: (response.c.521) -- after doc_root 
2012-09-27 02:09:34: (response.c.522) Doc-Root     : /var/www 
2012-09-27 02:09:34: (response.c.523) Rel-Path     : /media/ 
2012-09-27 02:09:34: (response.c.524) Path         : /var/www/media/ 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (response.c.541) -- logical -> physical 
2012-09-27 02:09:34: (response.c.542) Doc-Root     : /var/www 
2012-09-27 02:09:34: (response.c.543) Rel-Path     : /media/ 
2012-09-27 02:09:34: (response.c.544) Path         : /var/www/media/ 
2012-09-27 02:09:34: (response.c.561) -- handling physical path 
2012-09-27 02:09:34: (response.c.562) Path         : /var/www/media/ 
2012-09-27 02:09:34: (response.c.569) -- file found 
2012-09-27 02:09:34: (response.c.570) Path         : /var/www/media/ 
2012-09-27 02:09:34: (response.c.719) -- handling subrequest 
2012-09-27 02:09:34: (response.c.720) Path         : /var/www/media/ 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (mod_indexfile.c.150) -- handling the request as Indexfile 
2012-09-27 02:09:34: (mod_indexfile.c.151) URI          : /media/ 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (mod_access.c.135) -- mod_access_uri_handler called 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (mod_compress.c.719) -- handling file as static file 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 1 (cached) result: false 
2012-09-27 02:09:34: (configfile-glue.c.583) === start of condition block === 
2012-09-27 02:09:34: (configfile-glue.c.541) 2 (cached) result: true 
2012-09-27 02:09:34: (mod_staticfile.c.408) -- handling file as static file 
2012-09-27 02:09:34: (mod_staticfile.c.439) not a regular file: /media/ -> /var/www/media/ 
2012-09-27 02:09:34: (response.c.731) -- subrequest finished 
2012-09-27 02:09:34: (response.c.128) Response-Header: 
HTTP/1.1 404 Not Found
Content-Type: text/html
Content-Length: 345
Date: Thu, 27 Sep 2012 09:09:34 GMT
Server: lighttpd/1.4.31

It seems somehow it expected to see /var/www/media/ as a regular file, not a folder?

Also, since I have a few jpg files under /var/www/media for testing purpose, I tried http://192.168.0.220/media/Isles.jpg which was loaded and displayed OK!

[Update]: Tried with WebDav Navigator and it works great! so it must be browser related problem (tried with both Safari and Chrome).

Thanks for any advice,
-bodhi



Edited 2 time(s). Last edit at 09/27/2012 03:59AM by bodhi.
I needed to add a virtual host with the hostname (e.g. mydockstar). Now it works great on browser, too!

$HTTP["host"] == "mydockstar" {

   # enable directory listing
   server.dir-listing = "enable"

   $HTTP["url"] =~ "^/media($|/)" {
                 webdav.activate = "enable"
                 webdav.is-readonly = "enable"
                 auth.backend = "htpasswd"
                 auth.backend.htpasswd.userfile = "/etc/lighttpd/dav_auth"
                 auth.require = ( "" => ( "method" => "basic",
                         "realm" => "media_files",
                         "require" => "user=media" ) )
                 }
}
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: