Apache WebDav Module
You may require a sophisticated mechanism for viewing and modifying data when setting up a website. There are other ways to handle this, such as downloading and uploading updates using a local copy or using HTTP and FTP capabilities. Web-based Distributed Authoring and Versioning (WebDAV), on the other hand, is a simple substitute and is offered by the platform.
For Apache-based servers, WebDAV is quickly becoming an essential technology that makes website changes easier.
Enabling WebDAV Module for Apache Server
1. Click the Config button for the server in your environment.
2. The necessary `mod_dav` and `mod_dav_fs` modules are loaded by default. Simply add the following code to the VirtualHost configuration in the `/etc/httpd/conf/httpd.conf` file:
<Directory />
DAV on
</Directory>
3. Save the changes and restart Apache.
Setting Up Security Configuration
- Generate a hash from your password using any htpasswd tool or online service (e.g., htpasswdgenerator.net)
- Create a simple text file with the generated hash.
- Click the “Config” button for your Apache server.
- Upload the created file to the `/var/www/webroot/ROOT` folder.
- In the `/etc/httpd/conf` folder, open the `httpd.conf` file. Modify the directory configurations by adding the following lines as shown in the picture below:
AuthName "Restricted area"
AuthType Basic
AuthBasicProvider file
AuthUserFile /var/www/webroot/ROOT/.htpasswd
Require valid-user
- Save the changes and restart Apache.
Lastly, any WebDAV client will work. Connect to the server by entering the host (as well as your login information if you configured security). You’ll be able to view your files and make changes, additions, and edits to them.