Apache service with webdav

Apache service with webdav

我覺得這是個危險的服務

逼不得已才啟用

Enable dav_fs modules (Apache2)

\$ cd /etc/apache2/mods-enabled

\$ sudo ln -s /etc/apache2/mods-available/dav_fs.conf .

\$ sudo ln -s /etc/apache2/mods-available/dav_fs.load .

\$ sudo ln -s /etc/apache2/mods-available/dav.load .

sometimes you need to do this (ref http://ubuntuforums.org/showthread.php?p=2726196)

\$ sudo touch /var/lock/apache2/DAVLock

\$ sudo chown www-data /var/lock/apache2/DAVLock

Creating share space

\$ sudo mkdir /var/www/share_dav

\$ sudo chown www-data:www-data /var/www/share_dav

\$ sudo chmod 755 /var/www/share_dav

Suggest you using htpasswd for security reasion

\$ sudo htpasswd -c /var/www/.htpasswd dav_user

type password for dav_user

and edit apache configuration file

\$ sudo vi /etc/apache2/sites-enabled/000-default

Dav On

AuthType Basic

AuthName "Dav"

AuthUserFile /var/www/share_dav/.htpasswd

Require valid-user

Now, You can restart apache for testing your dav space

\$ sudo /etc/init.d/apache2 restart

Testing in Linux

\$ sudo apt-get install cadaver

\$ cadaver http://10.0.2.1/share_dav

input account like dav_user and password

type help for more information

convert from Thomas blog post id 165 old convert log: ./142719/tag%3E2007%2009%20linux)

@2007 @09 @linux

Comments