SGLMS

Tag : Centos

Como instalar WebDAV (Centos 7/8)

A. SGLMS , 02/11/2022

Hay mucha información sobre como instalar un servicio WeDav en Centos, pero la mayoría sólo funciona si quieren instalar el servicio WebDav y nada más.

Si quieres mantener tu servidor web y disponer además de un servicio WebDav, aquí está el camino:

# rpm -q centos-release
centos-release-7-7.1908.0.el7.centos.x86_64
# yum install epel-release httpd
# yum update -y
# httpd -M | grep dav
 dav_module (shared)
 dav_fs_module (shared)
 dav_lock_module (shared)

Creamos la carpeta que contendrá los archivos:

# mkdir /var/www/html/webdav
# chown -R apache:apache /var/www/html
# chmod -R 755 /var/www/html

Protege el acceso web con una contraseña:

# htpasswd -c /etc/httpd/.htpasswd username
New password: 
Re-type new password: 
Adding password for user username

También es recomendable cambiar los permisos de acceso:

# chown root:apache /etc/httpd/.htpasswd
# chmod 640 /etc/httpd/.htpasswd

Agrega un archivo de configuración para el servicio:

# vi /etc/httpd/conf.d/webdav.conf

Y, agregar lo siguiente:


 <IfModule mod_dav.c>
    LimitXMLRequestBody 131072
    Alias /webdav "/var/www/html/webdav"
    <Directory /var/www/html/webdav>
        Dav On
        Options +Indexes
        IndexOptions FancyIndexing
        AddDefaultCharset UTF-8
        AuthType Basic
        AuthName "WebDAV Server"
        AuthUserFile /etc/httpd/.htpasswd
        Require valid-user
        Order allow,deny
        Allow from all
    </Directory>
 </IfModule\>

Reiniciames el servidor apache:

# systemctl restart httpd

Y, eso es todo, ocupa un navegador e ingresa la dirección: http://xxx.xxx.xxx.xxx/webdav o puedes ocupar tu cliente dav preferido.

Entradas recientes


Archivos