Created
April 3, 2016 22:16
-
-
Save christopher-baek/beaf097945052948057ef6e118d4ad7e to your computer and use it in GitHub Desktop.
Apache WebDAV Configuration Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install apache | |
sudo apt-get install apache2 | |
# create a directory to use | |
sudo mkdir /var/www/webdav | |
sudo chown -R www-data:www-data /var/www/webdav | |
# enable modules | |
sudo a2enmod dav | |
sudo a2enmod dav_fs | |
sudo a2enmod dav_lock | |
# add lock to Apache virtual host configuration | |
DavLockDB /var/www/DavLock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add alias in virtual host | |
Alias /webdav /var/www/webdav | |
<Directory /var/www/webdav> | |
DAV On | |
</Directory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install utils to create digest authentication | |
sudo apt-get install apache2-utils |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create the password file | |
# -c is create for the first time | |
# first param is realm, second is username | |
sudo htdigest -c /etc/apache2/users ${REALM} ${USERNAME} | |
# make the file readable | |
sudo chown www-data:www-data /etc/apache2/users |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add block to configuration | |
AuthType Digest | |
AuthName "webdav" | |
AuthUserFile /etc/apache2/users.password | |
Require valid-user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# enable digest | |
sudo a2enmod auth_digest | |
sudo service apache2 restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
DocumentRoot /var/www/html | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
<IfModule mod_dav_fs.c> | |
DavLockDB /var/www/webdav/lock | |
Alias /webdav /var/www/webdav/data | |
<Directory /var/www/ubuntu2/webdav/data> | |
DAV On | |
</Directory> | |
</IfModule> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment