Preserve user permissions and deploy wordpress with caddy

Have you tried to serve caddy from /home/$users/www folders preserving user permissions?

I want to preserve user:user permissions as-is because users could connect vía sftp or ssh and modify their site files directly.

I’ve been playing with setfacl for www-data:www-data on these user home folders to raise privileges and caddy can start without errors which I assume caddy can access the folder but isn’t deploying the site until I assign www-data permissions.

Do you know what’s the problem here?

This is less of a Caddy question and more of a web server / Linux permissions question.

If you want to keep user:user ownership/group setup, in order to read the files, you need to:

  1. Run Caddy directly as user
  2. Run Caddy as a user that is a member of the user group
  3. Run Caddy as root

All of these have potential problems, such as privacy issues (i.e. the user can’t meaningfully designate which files the web server should be able to access).

My recommendation: Have the user set their ~/www folder’s ownership to user:www-data.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.