Difference between revisions of "WebDAV authentication"

From ArchWiki
Jump to: navigation, search
(Remove Development Category. Not directly related to Development.)
(simplification of wikilinks (testing https://github.com/lahwaacz/wiki-scripts/blob/master/link-checker.py))
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Networking]]
 
[[Category:Networking]]
 
{{Merge|WebDAV}}
 
{{Merge|WebDAV}}
--[[User:Andreas|Andreas]] 14:05, 18 December 2005 (EST)
 
 
 
==Goals==
 
==Goals==
 
The goal of this how to use simple authentication with WebDAV.
 
The goal of this how to use simple authentication with WebDAV.
Please refer to [[Simple_WebDav_Setup|Cactus']] superb write up on setting up WebDAV.
+
Please refer to [[WebDav]] on setting up WebDAV.
  
 
===Required packages===
 
===Required packages===
 
*apache
 
*apache
 
*cadaver (for testing)
 
*cadaver (for testing)
 
 
 
==WebDav Configuration==
 
==WebDav Configuration==
  
 
===Step 1: Edit /etc/httpd/conf/httpd.conf===
 
===Step 1: Edit /etc/httpd/conf/httpd.conf===
  
<pre>
+
{{bc|
 
DAVLockDB /var/log/httpd/DavLock/DavLockDB
 
DAVLockDB /var/log/httpd/DavLock/DavLockDB
 
<Location /dav>
 
<Location /dav>
Line 25: Line 21:
 
Require user foo
 
Require user foo
 
</Location>
 
</Location>
</pre>
+
}}
  
 
===Step 2: Create needed directories and assign permissions===
 
===Step 2: Create needed directories and assign permissions===
<pre>
+
{{bc|
 
# mkdir -p /var/log/httpd/DavLock
 
# mkdir -p /var/log/httpd/DavLock
 
# touch /var/log/httpd/DavLock/DavLockDB
 
# touch /var/log/httpd/DavLock/DavLockDB
Line 34: Line 30:
 
# mkdir -p /home/httpd/html/dav
 
# mkdir -p /home/httpd/html/dav
 
# chown -R nobody.nobody /home/httpd/html/dav
 
# chown -R nobody.nobody /home/httpd/html/dav
</pre>
+
}}
 
+
  
 
=== Step 3: Authentication ===
 
=== Step 3: Authentication ===
Line 44: Line 39:
  
 
This is an example for using digest (make sure it is enabled in httpd.conf)
 
This is an example for using digest (make sure it is enabled in httpd.conf)
<pre>
+
{{bc|htdigest -c /etc/httpd/conf/passwd WebDAV foo}}
htdigest -c /etc/httpd/conf/passwd WebDAV foo
+
</pre>
+
 
+
 
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.
 
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.
  
Line 53: Line 45:
  
 
If you want to permit everybody to read, you could use this in your httpd.conf
 
If you want to permit everybody to read, you could use this in your httpd.conf
<pre>
+
{{bc|
 
<Location /dav>
 
<Location /dav>
 
DAV On
 
DAV On
Line 63: Line 55:
 
</LimitExcept>
 
</LimitExcept>
 
</Location>
 
</Location>
</pre>
+
}}
  
 
=== Step 4: Restart apache ===
 
=== Step 4: Restart apache ===
<pre>
+
Restart {{ic|httpd.service}} to apply any changes.
# /etc/rc.d/httpd restart
+
</pre>
+

Latest revision as of 19:01, 30 May 2015

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#)

Goals

The goal of this how to use simple authentication with WebDAV. Please refer to WebDav on setting up WebDAV.

Required packages

  • apache
  • cadaver (for testing)

WebDav Configuration

Step 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>

Step 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 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>

Step 4: Restart apache

Restart httpd.service to apply any changes.