Goal
Use Apache as WebDAV server to allow synchronizing my browser bookmarks with the Floccus browser extension 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):
##
## 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: