Share files through WebDAV on OpenWrt
Install Lighttpd and WebDAV Auth modules
Configure Lighttpd
Available through
cp /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.bak Set a backup to facilitate the restoration in case of configuration errors.
server.document-root = "/mnt"
server.upload-dirs = ( "/tmp" ) server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "http"
server.groupname = "www-data"
index-file.names = ( "index.php" , "index.html" , "index.htm", "default.htm", ) static-file.exclude-extensions = ( ".php" , ".pl" , ".fcgi" ) ### Options that are useful but not always necessary:
#server.chroot = "/"
server.port = eighty-one
#server.bind = "localhost"
#server.tag = "lighttpd"
server.errorlog-use-syslog = "enable"
#server.network-backend = "writev"
### Use IPv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl"
dir-listing.encoding = "utf-8"
server.dir-listing = "enable" include "/etc/lighttpd/mime.conf" include "/etc/lighttpd/conf.d/*.conf"
Comments in the lighttpd configuration file are implemented by adding "#" before the line.
Configure WebDAV module
# ######################################################################
# #
# # WebDAV Module
# # ---------------
# #
# # See https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModWebDAV
# # server.modules += ( "mod_webdav" ) # $HTTP [ "url" ] =~ "^/dav($|/)" {
# #
# # enable webdav for this location
# # webdav.activate = "enable" # #
# # By default the webdav url is writable.
# # Uncomment the following line if you want to make it readonly.
# # webdav.is-readonly = "enable" # #
# # Log the XML Request bodies for debugging
# #
# webdav.log-xml = "disable"
# #
# #
# # webdav.sqlite-db-name = "/tmp/lighttpd-webdav.db" # }
# #
# ######################################################################
Ref
-
Content on OpenWrt Forum https://forum.openwrt.org/t/webdav-configuration-essense-with-lighttpd-on-openwrt/25357 -
Documents provided by Lighttpd https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModWebDAV
Configure Auth module
#######################################################################
##
## Authentication Module
## -----------------------
##
## See https://redmine.lighttpd.net/projects/lighttpd/wiki/docs_modauth
## for more info.
## server.modules += ( "mod_auth" ) auth.backend = "plain"
auth.backend.plain.userfile = "/etc/lighttpd/lighttpd.user"
#auth.backend.plain.groupfile = "/etc/lighttpd/lighttpd.group"
#auth.backend.ldap.hostname = "localhost"
#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
#auth.backend.ldap.filter = "(uid=$)"
auth.require = ( "/" => ( "method" => "basic" , "realm" => "Personal File Server" , "require" => "valid-user" ), ) ##
#######################################################################
user1:password1
user2:password2
Ref
-
Documents provided by Lighttpd https://redmine.lighttpd.net/projects/lighttpd/wiki/docs_modauth