Apache WebDAV Configuration

From ProjectDiaStar

Jump to: navigation, search

Here are instructions for setting up an Apache WebDAV file server and client for DiaStar Media files.

WebDAV File Server

The WebDAV server should be installed on a system other than the DiaStar server. The two systems should be on the same LAN to minimize latency when transferring and playing files. This procedure assumes that there is a working Apache web server already installed.

Edit /etc/httpd/conf/httpd.conf

Ensure the web dav modules have been enabled:

LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so

Make files available under the /media uri.

Alias /media /var/lib/diastar/media
<Location /media>
  DAV On
  AuthType Basic
  AuthName "diastar"
  AuthUserFile /var/lib/diastar/passwd.dav
  Require valid-user
</Location>
<Directory "/var/lib/diastar/media">
  Options Indexes FollowSymLinks MultiViews
</Directory>

Ensure /var/lib/diastar/media can be written by the apache user.

$ chown -R root:apache /var/lib/diastar/media 
$ chmod -R 770 /var/lib/diastar/media 

Create the WebDAV password file: /var/lib/diastar/passwd.dav with the user diastar

$ htpasswd -c -b /var/lib/diastar/passwd.dav diastar opendialogic

You will be prompted to enter a password for the user diastar. [opendialogic]

Change the permissions of the passwd.dav file so that only root and the members of the apache group can access it:

$ chown root:apache /var/lib/diastar/passwd.dav
$ chmod 640 /var/lib/diastar/passwd.dav

Restart the server:

$ service httpd restart

DiaStar WebDAV Client

Several packages must be added to a DiaStar ISO installation to use it as a WebDAV client:

fuse-2.6.3-2.el5.kb.i386.rpm
neon-0.25.5-10.el5.i386.rpm
fuse-davfs2-1.2.2-2.el5.rf.i386.rpm

Locate, download and install these with:

# rpm -ivh <package_name>

When these have been installed, create a mount point for the remote file system;

# mkdir -m 0666 -p /var/lib/diastar/media

The WebDav mount may either be done manually:

# mount.davfs  http://<WebDAV Server IP Addr>/media  /var/lib/diastar/media

or the following line added to /etc/fstab:

http://<WebDAV Server IP Addr>/media   /var/lib/diastar/media   davfs   noauto,user   0   

and then mounted with:

# mount /var/lib/diastar/media

Note that the file system cannot be automatically mounted. It is necessary to supply the username and password (diastar, opendialogic) when the WebDAV file system is mounted.

Personal tools