lighttpd

lighttpd upload denied, "directory does not exist" but it does


I have searched much for this, many posts mentions that the upload dir must be created and have proper permissions. It does.

The server is not running lighttpd in a chroot, as some have problems with.

When trying to upload large[1] files, I get this error in the log:

denying upload as opening to temp-file for upload failed: 
/var/cache/lighttpd/uploads, /var/cache/lighttpd/uploads/lighttpd-upload-Lo00Am 
No such file or directory

[1]Large: a 21KB attachment is fine, a 81KB is not.

lighttpd.conf:

server.document-root        = "/var/www/rma"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/support.error.log"
accesslog.filename            = "/var/log/lighttpd/support.access.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.max-request-size     = 1000000000
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80

The folder exists:

# ls -ld /var/cache/lighttpd/uploads
drwxrwxrwx 2 www-data www-data 4096 Jun  7 10:01 /var/cache/lighttpd/uploads

# uname -a
Linux somehostname 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux

# lighttpd -v
lighttpd/1.4.35 (ssl) - a light and fast webserver
Build-Date: Aug  2 2016 09:50:21

# php5-fpm -v
PHP 5.6.30-0+deb8u1 (fpm-fcgi) (built: Feb  8 2017 08:51:18)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Otherwise the website is fine (osTicket)


Solution

  • That looks like a bug that was fixed in lighttpd over a year ago. However, lighttpd 1.4.35 is over three years old. Latest lighttpd is 1.4.45 (and is part of Debian Stretch). Please test with a newer version of lighttpd.