Project

General

Profile

[Solved] lighttpd webdav 1.4.54 on raspberrypi error Could not access /webdav/ (not WebDAV-enabled?): 404 Not Found

Added by androidgeeksg about 5 years ago

Hi Guys,

I encountered following error when i test my lighttpd webdav using cadaver. I tried to search all the forums but there is no solution for error 404 i have encountered below.. appreciate your BIG help .. thank you

$ cadaver http://raspinasfileserver:8099/webdav
Authentication required for webdav on server `raspinasfileserver':
Username: webuser1
Password:
Could not access /webdav/ (not WebDAV-enabled?):
404 Not Found

my configuration file as follow:

server.modules = (
        "mod_webdav",
        "mod_auth",
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
#       "mod_rewrite",
)

server.document-root        = "/var/www/html" 
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log" 
server.pid-file             = "/var/run/lighttpd.pid" 
server.username             = "www-data" 
server.groupname            = "www-data" 
server.port                 = 8099

index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/" 
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl" 
include_shell "/usr/share/lighttpd/include-conf-enabled.pl" 
$SERVER["socket"] == ":8099" {
        server.name = "raspinasfileserver" 
        server.document-root = "/var/www/web1/web" 

        alias.url = ("/webdav" => "/var/www/web1/web")
        $HTTP["url"] =~ "^/webdav($|/)" {
                webdav.activate = "enable" 
                webdav.is-readonly = "disable" 
                webdav.sqlite-db-name = "/var/run/lighttpd/lighttpd.webdav_lock.db" 
                auth.backend = "htpasswd" 
                auth.backend.htpasswd.userfile = "/var/www/web1/passwd.dav" 
                auth.require = ( "" => ( "method" => "basic",
                        "realm" => "webdav",
                        "require" => "valid-user" ) )
        }
}


Replies (6)

RE: lighttpd webdav 1.4.54 on raspberrypi error Could not access /webdav/ (not WebDAV-enabled?): 404 Not Found - Added by gstrauss about 5 years ago

Please double-check that raspinasfileserver DNS resolves to your Pi.

Your problem is possibly that in server.modules, that mod_webdav is before mod_alias, so mod_alias is not running on the request before mod_webdav handles it.

.

Please note that there is a regression in lighttpd 1.4.54 mod_webdav which might cause lighttpd to crash at startup. See #2993 (with a patch to fix it). This will be fixed in the next lighttpd release (1.4.55)

RE: lighttpd webdav 1.4.54 on raspberrypi error Could not access /webdav/ (not WebDAV-enabled?): 404 Not Found - Added by androidgeeksg about 5 years ago

Hi,

Thanks for the prompt reply. Currently i move the mod_webdav at the end of the server.modules but the problem still persist.

And now i think the other issue might be the DNS related as you mentioned earlier.

Currently in my dhcpcd.conf i use following configuration

interface eth0
static ip_address=192.168.0.220/24
static routers=192.168.0.1
static domain_name_servers=8.8.8.8

and in the resolve.conf, i have this config
nameserver 8.8.8.8

as for /etc/hostname, i put the value RaspiNasFileServer

Is there a way to keep using this configuration while solving the issue i have for the lighttpd? appreciate your guidance on this.

Thank you.

RE: lighttpd webdav 1.4.54 on raspberrypi error Could not access /webdav/ (not WebDAV-enabled?): 404 Not Found - Added by gstrauss about 5 years ago

Have you tried using the IP address instead of the name "RaspiNasFileServer"?

RE: lighttpd webdav 1.4.54 on raspberrypi error Could not access /webdav/ (not WebDAV-enabled?): 404 Not Found - Added by androidgeeksg about 5 years ago

Hi,

Do you mean to put the IP address in the server.name of lighttpd.conf? if yes, i have tried it and still no luck.

Regards.

RE: lighttpd webdav 1.4.54 on raspberrypi error Could not access /webdav/ (not WebDAV-enabled?): 404 Not Found - Added by androidgeeksg about 5 years ago

Hi,

i solve the problem now, suggestion by gstrauss to move the mod_webdav after the mod_alias is working.. it just i have typo error on mod_webdav after i move the position in the lighttpd.conf

now i can use the server.name = <IP address> or <Host name> and it works fine when testing using cadaver.

Thanks a lot guys. for the help.

But i have another question how to enable multiple folder permission/access for different user like samba in this lighttpd webdav?

Example:
- i want to have multiple user has access on the certain folder
- i want to have multiple folder to be accessed by different users

How to go about it in the lighttpd.conf?

Appreciate your help.

RE: lighttpd webdav 1.4.54 on raspberrypi error Could not access /webdav/ (not WebDAV-enabled?): 404 Not Found - Added by gstrauss about 5 years ago

Try reading the doc and using a search engine. When you ask a question on a forum, indicate what you have tried (and demonstrate some effort).

Such questions will progressively get more curt replies (and eventually none).

See lighttpd mod_auth

    (1-6/6)