Webdav directory

  • This is a small howto to generate a webdav directory as subdirectory (alias) inside a domain. It's maybe not the best way, but it is working without any problems on my server!


    My Server:
    - Ubuntu 12.04.1 LTS
    - iMSCP 1.1.0-rc1.4
    - Apache2 with fcgi


    No idea if this is working for another linux distribution or if you do not use fcgi!


    All commands and configurations are made with user "root". If you have login to root disabled you have to use "sudo" as prefix for each comand.


    BACKUP YOUR FILES FIRST! This howto is at your own risk!


    First you have to enable the apache2 mod for dav:

    Code
    1. a2enmod dava2enmod dav_fs


    Now restart apache2:

    Code
    1. service apache2 restart


    Go to the directory of your domain (e.g. "/var/www/virtual/domain.tld") and create two directories:

    Code
    1. mkdir webdavmkdir webdavConfig


    webdav: folder with your webdav files
    webdavConfig: folder with webdav config files


    Change folder permissions:

    Code
    1. chown -c vu2xxx:www-data webdavConfigchown -c www-data:www-data webdav


    Replace vu2xxx with the user of your domain!


    Create empty config files:

    Code
    1. cd webdavConfigtouch .htpasswdtouch lockdb


    Change file permissions:

    Code
    1. chown -c vu2xxx:www-data .htpasswdchown -c vu2xxx:www-data lockdb


    Replace vu2xxx with the user of your domain!


    Add a user to your webdav space:

    Code
    1. htpasswd .htpasswd user


    For more information how to add/del users: "htpasswd --help"


    Go to directory "/etc/apache2/imscp" and open the webpage configuration for the domain you created the folders in (e.g. domain.tld.conf or subdomain.tld.conf).


    Now add the following lines:

    Code
    1. Alias /webdav "/var/www/virtual/domain.tld/webdav"DavLockDB "/var/www/virtual/domain.tld/webdavConfig/lockdb"<Directory "/var/www/virtual/domain.tld/webdav"> DAV on Options +Indexes AuthType Basic AuthName "Webdav" AuthUserFile "/var/www/virtual/domain.tld/webdavConfig/.htpasswd" Require valid-user</Directory>


    Note: If you are using one of the latest i-MSCP RC release, you must create the webdav and webdavConfig directories inside the 00_private directory.


    Restart your apache2 again to enable this configuration:

    Code
    1. service apache2 restart


    Now you can access http://domain.tld/webdav by browser or by using webdav tools like NetDrive. If you have a ssl cert for your domain you can also access the webdav folder by https!


    If you create the folders inside the "/var/www/virtual/domain.tld" iMSCP backup is creating a backup of it! (but I think it is not creating a backup of the edited /etc/apache2/imscp/domain.tld.conf file)

    Edited once, last by Nuxwin ().


  • This is a small howto to generate a webdav directory as subdirectory (alias) inside a domain. It's maybe not the best way, but it is working without any problems on my server!
    ...


    Hello ;


    Thank you for this howto. ;) Can you create a ticket HERE to explain the interest of WebDav with a link to that thread? Such option can be added to iMSCP using engine addon and gui plugin.


    Thanks you for using i-MSCP

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

    Edited once, last by Nuxwin ().

  • Re ;


    gOOvER Sorry, I've not seen it :D


    Edit: Thread link added to the ticket. ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

    Edited once, last by Nuxwin ().

  • I am unable to edit my HowTo post so some information:


    In newer I-MSCP versions you are no longer able to create folders insider your /var/www/virtual/domain.tld folder. Please use the /var/www/virtual/domain.tld/00_private folger instead!


  • I am unable to edit my HowTo post so some information:


    In newer I-MSCP versions you are no longer able to create folders insider your /var/www/virtual/domain.tld folder. Please use the /var/www/virtual/domain.tld/00_private folger instead!


    Hello ;


    Info added in the howto. Don't understand why you cannot edit it. Try with another browser please.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Thank your very much Nuxwin! Now after deleting all cache files (google chrome) all works again for me :P