Difference between revisions of "WebDAV authentication"

From ArchWiki
Jump to: navigation, search
(change category to WebDAV)
(style)
 
Line 1: Line 1:
 
[[Category:WebDAV]]
 
[[Category:WebDAV]]
 
{{Merge|WebDAV}}
 
{{Merge|WebDAV}}
==Goals==
 
The goal of this how to use simple authentication with WebDAV.
 
Please refer to [[WebDAV]] on setting up WebDAV.
 
  
===Required packages===
+
This article outlines how to use simple authentication with [[WebDAV]].
*apache
 
*cadaver (for testing)
 
  
==WebDav Configuration==
+
=== Required packages ===
 +
* apache
 +
* cadaver (for testing)
  
===Step 1: Edit /etc/httpd/conf/httpd.conf===
+
== WebDav Configuration ==
  
{{bc|
+
1) Edit {{ic|/etc/httpd/conf/httpd.conf}}:
DAVLockDB /var/log/httpd/DavLock/DavLockDB
+
 
<Location /dav>
+
DAVLockDB /var/log/httpd/DavLock/DavLockDB
DAV On
+
<Location /dav>
AuthType Digest
+
DAV On
AuthName "WebDAV"
+
AuthType Digest
AuthUserFile /etc/httpd/conf/passwd
+
AuthName "WebDAV"
Require user foo
+
AuthUserFile /etc/httpd/conf/passwd
</Location>
+
Require user foo
}}
+
</Location>
 +
 
 +
2) Create needed directories and assign permissions
 +
 
 +
# mkdir -p /var/log/httpd/DavLock
 +
# touch /var/log/httpd/DavLock/DavLockDB
 +
# chown -R nobody.nobody /var/log/httpd/DavLock
 +
# mkdir -p /home/httpd/html/dav
 +
# chown -R nobody.nobody /home/httpd/html/dav
  
===Step 2: Create needed directories and assign permissions===
+
3) Authentication
{{bc|
 
# mkdir -p /var/log/httpd/DavLock
 
# touch /var/log/httpd/DavLock/DavLockDB
 
# chown -R nobody.nobody /var/log/httpd/DavLock
 
# mkdir -p /home/httpd/html/dav
 
# chown -R nobody.nobody /home/httpd/html/dav
 
}}
 
  
=== Step 3: Authentication ===
 
 
There are numerous different protocols you can use:
 
There are numerous different protocols you can use:
 
* plain
 
* plain
Line 58: Line 55:
 
}}
 
}}
  
=== Step 4: Restart apache ===
+
4) Restart apache ({{ic|httpd.service}}) to apply the changes.
Restart {{ic|httpd.service}} to apply any changes.
 

Latest revision as of 06:38, 31 December 2017

Merge-arrows-2.pngThis article or section is a candidate for merging with WebDAV.Merge-arrows-2.png

Notes: please use the second argument of the template to provide more detailed indications. (Discuss in Talk:WebDAV authentication#)

This article outlines how to use simple authentication with WebDAV.

Required packages

  • apache
  • cadaver (for testing)

WebDav Configuration

1) Edit /etc/httpd/conf/httpd.conf:

DAVLockDB /var/log/httpd/DavLock/DavLockDB
<Location /dav>
DAV On
AuthType Digest
AuthName "WebDAV"
AuthUserFile /etc/httpd/conf/passwd
Require user foo
</Location>

2) Create needed directories and assign permissions

# mkdir -p /var/log/httpd/DavLock
# touch /var/log/httpd/DavLock/DavLockDB
# chown -R nobody.nobody /var/log/httpd/DavLock
# mkdir -p /home/httpd/html/dav
# chown -R nobody.nobody /home/httpd/html/dav

3) Authentication

There are numerous different protocols you can use:

  • plain
  • digest
  • others

This is an example for using digest (make sure it is enabled in httpd.conf)

htdigest -c /etc/httpd/conf/passwd WebDAV foo

Please make sure that the path is identical to the one you entered in your httpd.conf. Also when using digest you have to enter the AuthName from httpd.conf. For plain authentication you would not need this.

With the above setup the user *foo* is required for everything.

If you want to permit everybody to read, you could use this in your httpd.conf

<Location /dav>
DAV On
AuthType Digest
AuthName "WebDAV"
AuthUserFile /etc/httpd/conf/passwd
<LimitExcept GET HEAD OPTIONS PROPFIND>
require user foo
</LimitExcept>
</Location>

4) Restart apache (httpd.service) to apply the changes.