While there are many tutorials around on how to add WebDAV on apache (using mod_dav
) for a single user/folder (e.g. /var/www/webdav
) I can’t find any tutorial that explains how to use mod_dav
to allow per-user access to heir home folders.
This would require (a) local authentication (PAM), (b) rewrite requests to webdav://myuser@myserver/webdav
to /home/myuser/
, © set apache to access files as the authenticated user instead of www-data.
I use Ubuntu 22.04
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya,
To set up Apache with WebDAV to allow local users to access their home folders on Ubuntu 22.04, you need to configure:
/webdav
to the corresponding home folder.fcgiwrap
to allow Apache to run as the authenticated user. Install Required PackagesEnable necessary modules:
Configure WebDAV Directory Create the WebDAV directory in each user’s home:
Ensure ownership is correct:
Configure Apache Virtual Host
Edit or create a new Apache configuration file:
Add the following:
then Enable the Site and Restart Apache:
Next is to Adjust PAM for Apache Authentication
Modify
/etc/pam.d/apache2
:Add:
This enables per-user WebDAV home directory access with PAM authentication while ensuring Apache serves files as the authenticated user. Let me know if you need further refinements! 🚀