6.19. Enabling WebDAV Without Making Files Writable by the Web User
Problem
You want to run WebDAV but don’t want to make your document files writable by the Apache server user.
Solution
Run two Web servers as different users. The DAV-enabled server,
for example, might run as User
dav, Group
dav, whereas the other server, which is responsible
for serving your content, might run as User nobody, Group nobody. Make the Web
content writable by the dav user,
or the dav group.
Tip
Remember that only a single Web server can be handling a particular port/IP address combination. This means that your WebDAV-enabled server will have to be using either a different address, a different port, or both than the non-WebDAV server.
Discussion
A big security concern with DAV is that the content must be modifiable by the Web server user for DAV to be able to update that content. This means that any content also can be edited by CGI programs, SSI directives, or other programs running under the Web server. Although the Apache security guidelines caution against having any files writable by the Web server user, DAV requires it.
By running two Apache servers, you can move around this limitation. The DAV-enabled Web server, running on an alternate port, has the User and Group directives set to an alternate user and group, such as:
User dav Group dav
which is the owner of the Web content in question. The other Web server, which will be responsible for serving content to users, runs as a user who does not have permission ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access