# Apache2 WebDAV for bookmark synchronization with Floccus

**URL:** https://discuss.freedombox.org/t/apache2-webdav-for-bookmark-synchronization-with-floccus/3651
**Category:** Tips and Tricks
**Created:** [March 2, 2025, 4:08pm UTC](https://discuss.freedombox.org/t/apache2-webdav-for-bookmark-synchronization-with-floccus/3651 "2025-03-02T16:08:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kopfkind](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/kopfkind/32/625_2.png) [@kopfkind](https://discuss.freedombox.org/u/kopfkind)
#### Post date: [March 2, 2025, 4:08pm UTC](https://discuss.freedombox.org/t/apache2-webdav-for-bookmark-synchronization-with-floccus/3651/1 "2025-03-02T16:08:50Z")

</div>

## Goal

Use Apache as WebDAV server to allow synchronizing my browser bookmarks with the [Floccus browser extension](https://floccus.org/) or for arbitrary data transfers

(!) Note: This setup side-steps the SSO configuration used with FreedomBox (FB) because otherwise FB would force a redirect to the login page for login - and this will not work with Floccus. If you just want a DAV folder, you may want to use `mod_pub_authtkt` instead (not covered here - but see all the other services your FB has for examples).

## Requirements

- Familiarity with the command line, e. g. using SSH to connect to your FreedomBox
- SSH access to you FB, admin privileges to reload services

## Steps

Log into your FB using SSH with a superuser account

```
ssh superuser@fb.example.org

```

Create a new folder where data will be stored and set proper permissions

```
sudo mkdir /var/lib/folder
sudo chown www-data:www-data /var/lib/folder

```

Create a file with credentials for access:

```
sudo htpasswd -c /etc/apache2/users.htaccess username
# enter password twice when prompted

```

Add a new Apache configuration file that exposes the new folder over DAV:

```
sudo vim /etc/apache2/conf-available/dav.conf

```

Enter the following contents into this new file (and adjust as needed for your setup):

```auto
##
## Allow WebDAV for /var/lib/folder
##

Alias /folder /var/lib/folder

<Location /folder>
    AuthType Basic
    AuthName DAV
    AuthUserFile "/etc/apache2/users.htaccess"
    Require valid-user
</Location>

<Directory /var/lib/folder>
    Dav On

    # Don't accept overrides in .htaccess
    AllowOverride None

    # Disable following symlinks, show an index page
    Options Indexes
</Directory>

```

Enable this new configuration:

```
sudo a2enconf dav

```

Then reload the `apache2` service to activate it:

```
sudo systemctl reload apache2

```

## Testing DAV access

With a file-manager that allows browsing DAV shared (e. g. Gnome’s Files app) you can try out the setup using a proper connect string:

```
davs://username@fb.example.org/folder

```

## Set up Floccus

Follow the official guide for WebDAV here:

- [Guides and How tos - Floccus bookmarks sync](https://floccus.org/guides)

---

<div class="post-metadata">

### Author: ![Sunil](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/sunil/32/8_2.png) [@Sunil](https://discuss.freedombox.org/u/Sunil)
#### Post date: [March 2, 2025, 4:48pm UTC](https://discuss.freedombox.org/t/apache2-webdav-for-bookmark-synchronization-with-floccus/3651/2 "2025-03-02T16:48:40Z")

</div>

Thank you for the guide. One way to simplify this is to use LDAP authentication with accounts created with FreedomBox. This can avoid the need to create separate accounts in the htaccess file.

```auto
<Location /folder>
    Include includes/freedombox-auth-ldap.conf
    Require valid-user
</Location>

```

---

<div class="post-metadata">

### Author: ![kopfkind](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/kopfkind/32/625_2.png) [@kopfkind](https://discuss.freedombox.org/u/kopfkind)
#### Post date: [March 2, 2025, 5:34pm UTC](https://discuss.freedombox.org/t/apache2-webdav-for-bookmark-synchronization-with-floccus/3651/3 "2025-03-02T17:34:21Z")

</div>

@Sunil Wow, that’s great! I didn’t know, thanks!

Does this LDAP auth allow some kind of authorization, e. g. roles? Or would it just mean “any user that can authenticate” against my FB?

---

<div class="post-metadata">

### Author: ![Sunil](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/sunil/32/8_2.png) [@Sunil](https://discuss.freedombox.org/u/Sunil)
#### Post date: [March 2, 2025, 6:36pm UTC](https://discuss.freedombox.org/t/apache2-webdav-for-bookmark-synchronization-with-floccus/3651/4 "2025-03-02T18:36:55Z")

</div>

Authorization can be done as follows:

```auto
<Location ...>
    ...
    Require ldap-group cn=admin,ou=groups,dc=thisbox
    Require ldap-group cn=bit-torrent,ou=groups,dc=thisbox
</Location>

```

To require either admin or bit-torrent group. See full list of groups in User → Edit page.
