当前位置:网站首页>Configure WebDAV server on Apache

Configure WebDAV server on Apache

2022-07-04 13:09:00 Brother Xing plays with the clouds

WebDAV This enables applications to write files directly to Web Server On , And you can lock the file when writing it , Unlock the file after writing , It can also support version control of files . be based on WebDAV It can realize a powerful content management system or configuration management system . Now the mainstream WEB The server Generally speaking, they support WebDAV. The following is a more detailed introduction WebDAV stay APACHE The server Configuration in .

One 、 modify httpd.conf file

Add the following at the end :

Include conf/mod_dav.conf # Next, we will introduce the settings of this file

Two 、 stay apache/conf/ Create a new file under the directory (mod_dav.conf), And enter the following

#Dav LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so DAVLockDB var/DavLock Alias /webdav “/home/webdavfolder” # The next path is the computer ( or The server ) A folder on the hard disk , Space for network storage Dav On

This configuration , In fact, you can visit ( It can be done by windows Network Neighborhood access for ). But this has a fatal disadvantage is that you can access it without a password , The installability is greatly reduced .

3、 ... and 、 Add security configuration

Continue editing the file in step 2 above , Change it to :

#Dav filesystem DAVLockDB var/DavLock Alias /webdav “/home/webdavfolder” Dav On AuthType Basic AuthName DAV AuthUserFile /usr/local/svn/svn-auth-file # Password verification file require user user1

Four 、/usr/local/svn/svn-auth-file File creation

Get into apache/bin Catalog , Execute the following command to generate a password verification file :

htpasswd -cm /usr/local/svn/svn-auth-file user1

Enter the password of the user when prompted for password .

If you need to add users user2, Then execute the following command :

htpasswd -m /usr/local/svn/svn-auth-file user2

Delete a user (user2), The following instructions can be used :

htpasswd -D /usr/local/svn/svn-auth-file user2

5、 ... and 、 After the modification is completed , restart apache

At this time, you can safely access WebDAV 了 . Can pass http://localhost/webdav To access shared resources . Of course , If you are configured on the server , Use http://yourdomain.tld/webdav To visit in the form of . User name and password are the contents of the above settings .

notes : The above configuration has not been verified , For reference only

原网站

版权声明
本文为[Brother Xing plays with the clouds]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207041234126674.html