Lighttpd webdav: Difference between revisions

From wikinotes
 
(4 intermediate revisions by the same user not shown)
Line 14: Line 14:
= Configuration =
= Configuration =
<blockquote>
<blockquote>
{{ expand
{{ TODO |
| <code>/usr/local/etc/lighttpd/modules.conf</code>
this is WIP instructions
|
}}


The order of the modules is important.<br>
{{ NOTE |
Maybe copy the <code>modules.conf.example</code> so you can keep track of changes between updates?
lighttpd must be compiled with sqlite support <code>./configure --with-webdav-props</code>.<br>
you'll need to build it from ports on freebsd
}}


<syntaxhighlight lang="dosini">
Ignore <code>modules.conf</code> and the various <code>conf.d/*.conf</code> files,<br>
include conf_dir + "/conf.d/webdav.conf"
but mind your module order according to <code>module.conf</code>'s instructions.
</syntaxhighlight>


}}
<syntaxhighlight lang="bash">
# Global Vars
var.log_root = "/var/log/lighttpd"
var.server_root = "/usr/local/www/lighttpd"
var.state_dir = "/var/run"
var.home_dir = "/var/run/lighttpd"
var.conf_dir = "/usr/local/etc/lighttpd"


{{ expand
# Enable Modules
| <code>/usr/local/etc/lighttpd/lighttpd.conf</code>
server.modules = (
|
    "mod_access",
    "mod_webdav",
)


INCOMPLETE:
# Daemon Settings
server.username = "www"
server.groupname = "www"
server.pid-file = state_dir + "/lighttpd.pid"
server.errorlog = log_root + "/error.log"
include conf_dir + "/conf.d/access_log.conf"
include conf_dir + "/conf.d/mime.conf"


<syntaxhighlight lang="dosini">
# Server
reroute webdav
webdav.activate = "enable"
server.document-root = "/usr/local/www/lighttpd-webdav/data"
server.sqlite-db-name = "/usr/local/www/lighttpd-webdav/webdav.db"
server.bind "0.0.0.0"
server.port = 80
server.use-ipv6 = "disable"


server.modules = {
# ... add auth semantics ...
    "mod_webdav",
 
    $HTTP["host"] == "foo.com" {
        server.document-root = "/usr/local/www/foo.com/site"
        $["url"] =~ "^/orgmode($|/)" {
            webdav.activate = "enable"
            webdav.is-readonly = "disable"
            webdav.sqlite-db-name = "/usr/local/www/foo.com/lighttpd-webdav.db"
            auth.backend = ""
        }
    }
}
</syntaxhighlight>
</syntaxhighlight>
}}
</blockquote><!-- Configuration -->
</blockquote><!-- Configuration -->

Latest revision as of 16:35, 12 February 2023

Let's create an authenticated webdav server, hosted by lighttpd.

Tutorials

lighttpd webdav on debian https://www.howtoforge.com/tutorial/how-to-install-webdav-with-lighttpd-on-debian-jessie/
lighttpd webdav https://gist.github.com/dream1986/4e4a1f24c0b24d216d75e2f9e25fc78d

Configuration

TODO:

this is WIP instructions

NOTE:

lighttpd must be compiled with sqlite support ./configure --with-webdav-props.
you'll need to build it from ports on freebsd

Ignore modules.conf and the various conf.d/*.conf files,
but mind your module order according to module.conf's instructions.

# Global Vars
var.log_root = "/var/log/lighttpd"
var.server_root = "/usr/local/www/lighttpd"
var.state_dir = "/var/run"
var.home_dir = "/var/run/lighttpd"
var.conf_dir = "/usr/local/etc/lighttpd"

# Enable Modules
server.modules = (
    "mod_access",
    "mod_webdav",
)

# Daemon Settings
server.username = "www"
server.groupname = "www"
server.pid-file = state_dir + "/lighttpd.pid"
server.errorlog = log_root + "/error.log"
include conf_dir + "/conf.d/access_log.conf"
include conf_dir + "/conf.d/mime.conf"

# Server
webdav.activate = "enable"
server.document-root = "/usr/local/www/lighttpd-webdav/data"
server.sqlite-db-name = "/usr/local/www/lighttpd-webdav/webdav.db"
server.bind "0.0.0.0"
server.port = 80
server.use-ipv6 = "disable"

# ... add auth semantics ...