WebDAV With Lighttpd On Mandriva 2008.1

Discussion in 'Installation/Configuration' started by Juergen Harms, Jan 13, 2009.

  1. Juergen Harms

    Juergen Harms New Member

    I have enjoyed the clear instructions in "How To Set Up WebDAV With Lighttpd On Mandriva 2008.1" - but got stuck and need help.

    Everything runs smoothly and without any error messages until I come to "5 Testing WebDAV" using cadaver:
    [harms@pcjuergen ~]# cadaver http://www.example.com/webdav/
    Could not access /webdav/ (not WebDAV-enabled?):
    405 Method Not Allowed
    Connection to `www.example.com' closed.
    dav:!> quit
    I have tried both on Mandriva 2008.1 (no httpd modules installed so far) and 2009.0 (httpd already installed), same result. I am not at all expert in this domain and would be very thankful for any help on how to clarify / proceed (I am quite knowledgeable on general Linux configuration and installation topics). I have found no reference to this problem in the Mandriva forums. http traffic is not blocked by the Mandriva firwall (shorewall).

    One small comment to the HOWTO: it suggests to install the lighttpd packages and the apache-base package as a single action - if you follow this advice, Mandriva starts by installing lightlpd with the warning
    warning: group apache does not exist - using root
    warning: user apache does not exist - using root
    This can be avoided by, in a first step, only installing apache-base; I suggest to correspondingly adapt the HOWTO when the next revision is done
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Are there any errors in Apache's error log when this happens?
     
  3. Juergen Harms

    Juergen Harms New Member

    Thank you for replying. Here is what I can see:

    The last message in the apache error-log (/var/log/httpd/error_log) is the shutdown message issued when the httpd daemon was stopped.
    [Wed Jan 14 15:09:31 2009] [notice] caught SIGTERM, shutting down​

    Launching the lighttpd daemon does not produce any messages in that error log (not even the initialisation entries which I get when running the httpd daemon), there is one message in the lighthttpd errorlog (/var/log/lighttpd/error_log) confirming that that daemon really started.
    2009-01-14 15:10:43: (log.c.75) server started ​

    After launching the lighthttpd daemon, I tried "apachectl status" and get "404 - Not Found". A port scan on the server gives "80/tcp open http lighttpd 1.4.19". That looks OK, it seems like the communication between the lighttpd daemon and the application is not correctly working.

    While I use the httpd daemon, apache works as it should - I use it for communicating with BackupPC (no modifications done to the configuration files that were installed by the packages).
     
  4. falko

    falko Super Moderator Howtoforge Staff

    What's in /etc/lighttpd/lighttpd.conf, and what's the output of
    Code:
    netstat -tap
    ?
     
  5. Juergen Harms

    Juergen Harms New Member

    [root@pcjuergen ~]# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 *:rsync *:* LISTEN 2955/xinetd
    tcp 0 0 *:http *:* LISTEN 17187/lighttpd
    tcp 0 0 *:x11 *:* LISTEN 2452/X
    tcp 0 0 *:ftp *:* LISTEN 3009/proftpd: (acce
    tcp 0 0 *:ssh *:* LISTEN 2994/sshd
    tcp 0 0 pcjuergen.unige.ch:smtp *:* LISTEN 3186/master
    tcp 0 0 pcjuergen.local:37514 212.243.221.231:http ESTABLISHED 17057/firefox
    tcp 0 0 *:x11 *:* LISTEN 2452/X
    tcp 0 0 *:ssh *:* LISTEN 2994/sshd
    tcp 0 0 *:ipp *:* LISTEN 2793/cupsd



    --------------- contents of /etc/lighthhpd (some comment lines dropped)

    # lighttpd configuration file
    #
    # use it as a base for lighttpd 1.0.0 and above
    #
    # $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $

    ############ Options you really have to take care of ####################

    ## modules to load
    # at least mod_access and mod_accesslog should be loaded
    # all other module should only be loaded if really neccesary
    # - saves some time
    # - saves memory
    server.modules = (
    # "mod_rewrite",
    # "mod_redirect",
    "mod_alias",
    "mod_access",
    # "mod_cml",
    # "mod_trigger_b4_dl",
    "mod_webdav",
    "mod_auth",
    # "mod_status",
    # "mod_setenv",
    # "mod_fastcgi",
    # "mod_proxy",
    # "mod_simple_vhost",
    # "mod_evhost",
    # "mod_userdir",
    # "mod_cgi",
    # "mod_compress",
    # "mod_ssi",
    # "mod_usertrack",
    # "mod_expire",
    # "mod_secdownload",
    # "mod_rrdtool",
    "mod_accesslog" )

    ## a static document-root, for virtual-hosting take look at the
    ## server.virtual-* options
    server.document-root = "/var/www/html"

    ## where to send error-messages to
    server.errorlog = "/var/log/lighttpd/error.log"

    # files to check for if .../ is requested
    index-file.names = ( "index.php", "index.html",
    "index.htm", "default.htm" )

    ## set the event-handler (read the performance section in the manual)
    # server.event-handler = "freebsd-kqueue" # needed on OS X

    # mimetype mapping
    mimetype.assign = (
    ".pdf" => "application/pdf",
    ".sig" => "application/pgp-signature",
    ".spl" => "application/futuresplash",
    ".class" => "application/octet-stream",
    ".ps" => "application/postscript",
    ".torrent" => "application/x-bittorrent",
    ".dvi" => "application/x-dvi",
    ".gz" => "application/x-gzip",
    ".pac" => "application/x-ns-proxy-autoconfig",
    ".swf" => "application/x-shockwave-flash",
    ".tar.gz" => "application/x-tgz",
    ".tgz" => "application/x-tgz",
    ".tar" => "application/x-tar",
    ".zip" => "application/zip",
    ".mp3" => "audio/mpeg",
    ".m3u" => "audio/x-mpegurl",
    ".wma" => "audio/x-ms-wma",
    ".wax" => "audio/x-ms-wax",
    ".ogg" => "application/ogg",
    ".wav" => "audio/x-wav",
    ".gif" => "image/gif",
    ".jar" => "application/x-java-archive",
    ".jpg" => "image/jpeg",
    ".jpeg" => "image/jpeg",
    ".png" => "image/png",
    ".xbm" => "image/x-xbitmap",
    ".xpm" => "image/x-xpixmap",
    ".xwd" => "image/x-xwindowdump",
    ".css" => "text/css",
    ".html" => "text/html",
    ".htm" => "text/html",
    ".js" => "text/javascript",
    ".asc" => "text/plain",
    ".c" => "text/plain",
    ".cpp" => "text/plain",
    ".log" => "text/plain",
    ".conf" => "text/plain",
    ".text" => "text/plain",
    ".txt" => "text/plain",
    ".dtd" => "text/xml",
    ".xml" => "text/xml",
    ".mpeg" => "video/mpeg",
    ".mpg" => "video/mpeg",
    ".mov" => "video/quicktime",
    ".qt" => "video/quicktime",
    ".avi" => "video/x-msvideo",
    ".asf" => "video/x-ms-asf",
    ".asx" => "video/x-ms-asf",
    ".wmv" => "video/x-ms-wmv",
    ".bz2" => "application/x-bzip",
    ".tbz" => "application/x-bzip-compressed-tar",
    ".tar.bz2" => "application/x-bzip-compressed-tar",
    # default mime type
    "" => "application/octet-stream",
    )

    # Use the "Content-Type" extended attribute to obtain mime type if possible
    #mimetype.use-xattr = "enable"


    ## send a different Server: header
    ## be nice and keep it at lighttpd
    # server.tag = "lighttpd"

    #### accesslog module
    accesslog.filename = "/var/log/lighttpd/access.log"

    ## deny access the file-extensions
    #
    # ~ is for backupfiles from vi, emacs, joe, ...
    # .inc is often used for code includes which should in general not be part
    # of the document-root
    url.access-deny = ( "~", ".inc" )

    $HTTP["url"] =~ "\.pdf$" {
    server.range-requests = "disable"
    }

    ##
    # which extensions should not be handle via static-file transfer
    #
    # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
    static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

    ######### Options that are good to be but not neccesary to be changed #######



    ### --- snip comment lines



    ### only root can use these options
    #
    # chroot() to directory (default: no chroot() )
    #server.chroot = "/"

    ## change uid to <uid> (default: don't care)
    server.username = "apache"

    ## change uid to <uid> (default: don't care)
    server.groupname = "apache"



    ### --- snip comment lines



    $HTTP["host"] == "www.example.com" {
    server.document-root = "/var/www/web1/web"
    alias.url = ( "/webdav" => "/var/www/web1/web" )
    $HTTP["url"] =~ "^/webdav($|/)" {
    dir-listing.activate = "enable"
    webdav.activate = "enable"
    webdav.is-readonly = "disable"
    auth.backend = "htpasswd"
    auth.backend.htpasswd.userfile = "/var/www/web1/passwd.dav"
    auth.require = ( "" => ( "method" => "basic",
    "realm" => "webdav",
    "require" => "valid-user" ) )
    }
    }
     
  6. Juergen Harms

    Juergen Harms New Member

    Looks like I made a mistake in textually copying the host address as www.example.com -
    will check that tomorrow

    Cheers
     
  7. falko

    falko Super Moderator Howtoforge Staff

    Yes, that's most likely the problem.
     

Share This Page