WebDAV Server install and setup with Apache 2.0.x on SuSE

In the following lines to be executed on the shell start with a "$" or a "#". "#" denotes an execution of the command as root, whereas "$" can be executed as a regular user. If not stated otherwise the actions are to be executed from within a designated directory from where the build process will be started.

Note: Be careful when building the server packages. Usually SuSE is terrible with keeping a good dependency handling. So it is really a pain in the ass to track down and resolve all dependencies for setups of packages other than the one originally shipped with the distro's version. Even though it would be sweet to use the occasion of building packages to upgrade to a current version ... :-/

Necessities: Apache web server and GDBM libraries (incl. dev-Packages), and the openssl packages

  • install (e. g. using YaST) the packages "gdbm", "gdbm-devel", "openssl", and "openssl-devel".

Get the sources and modify them according to our needs

  • Find them at: http://ftp.suse.com/pub/suse/i386/ in directory <distro version>/suse/src/
  • download SRC-RPM: apache2-2.0.xx-yy.src.rpm
  • install it:
    • # rpm -i apache2-2.0.xx-yy.src.rpm
  • sources can be found in hierarchy underneath /usr/src/packages

Configure sources for building and packaging

  • edit /usr/src/packages/SPECS/apache2.spec:
    • insert a switch --with-gdbm into the "configure" section (with all other switches)
  • build RPM from sources as binary package (prep, compile, install, package):
    • # rpm -bb /usr/src/packages/SPECS/apache2.spec
    • or # rpm -bb --target=i586 /usr/src/packages/SPECS/apache2.spec for better optimization

Install packages

  • Install created packages. They are located in /usr/src/packages/RPMS/<arch>, where <arch> is usually like "i386" or "i586" depending on the built target architecture (see above at building packages):
    • # rpm -Uhv libapr0-2.0.*.rpm apache2-2.0.*.rpm apache2-worker-2.0.*.rpm
  • Additionally the packages apache2-doc, apache2-example-pages, or apache2-devel package may be desired, or another version of the server itself (apache2-leader, apache2-prefork, apache2-* packages) may be tried.

Adjust Apache config:

  • file /etc/apache2/httpd.conf
  • edit section <Directory /srv/www/htdocs>
    • add lines at beginning of block:
      DAV on
      DAVDepthInfinity on
  • add lock file statement after block:
    DAVLockDB /var/lock/DAVLock
  • create lock DB and set permissions correctly:
    • # touch /var/lock/DAVLock.dir
    • # touch /var/lock/DAVLock.pag
    • # chown wwwrun /var/lock/DAVLock.*
  • the following two lines need to be added to file /etc/apache2/suse_loadmodule.conf:
 
LoadModule dav_module                     /usr/lib/apache2-worker/mod_dav.so
LoadModule dav_fs_module                  /usr/lib/apache2-worker/mod_dav_fs.so
  • check for those lines in httpd.conf, remove if in there ...
  • in file /etc/sysconfig/apache2 add "dav" and "dav_fs" to module list variable APACHE_MODULES
  • check configuration with apache2ctl configtest
  • # /etc/init.d/apache2 restart

Test:

  • browse to http://server.name.domain/
  • with Konqueror browse to webdav://server.name.domain/webdav/
  • check to add a resource (copy, mkdir, etc.)

Performance tuning:

  • In the first section of httpd.conf add a line:
    SendBufferSize 31000
  • restart server
    • # /etc/init.d/apache2 restart

More info on building RPMs for SuSE can be found here: