Bug #1027

alias and mod_compress

Added by Anonymous over 2 years ago. Updated about 1 year ago.

Status:Fixed Start:
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:mod_compress
Target version:-

Description

When using an alias, mod_compress dosent create subdirectories for the cached compressed files.

Exmaple

www.domain1.com/my.css

www.domain2.com/n/my.css (n is an alis to domain1.com)

error:
2007-02-12 12:57:03: (mod_compress.c.398) creating cachefile /var/lib/lighttpd/cache/compress//n/themes/obalanet/screen.css-gzip-7964071-2250-1170856112 failed No such file or directory

but /var/lib/lighttpd/cache/compress/ exists.

-- duck

Fix-mod_compress-bug-1027-lighty1.4.patch - Tested patch (previous missed symbol "ERROR"), ignore trailing slash now (3.1 KB) stbuehler, 02/15/2008 03:06 pm

Fix-mod_compress-bug-1027-lighty1.5.patch - Ignore trailing slash now + ERROR log style (7.1 KB) stbuehler, 02/15/2008 03:42 pm

lighttpd-1.4.18-compress-mkdir.patch - Optimized version of patch for 1.4.18. (2.8 KB) spillgroup, 03/07/2008 01:42 pm

lighttpd-1.4.19-compress-mkdir.patch - Optimization patch for 1.4.19 (1.1 KB) spillgroup, 03/12/2008 01:56 pm

History

Updated by darix over 2 years ago

can you show us the module load order?
the easiest thing might be lighttpd -tp -f /path/to/config 2>&1 | less
and paste the server.modules section from it.

Updated by Anonymous over 2 years ago

cachefile /var/lib/lighttpd/cache/compress//n/themes/obalanet/screen.css-gzip-7964071-2250-1170856112

isn't there one slash too many after comptess?

-- j3rky

Updated by Anonymous over 2 years ago

I'm having the same problem here. Is there a solution?

My server.modules section:


server.modules = (
    "mod_indexfile",
    "mod_access",
    "mod_alias",
    "mod_accesslog",
    "mod_rewrite",
    "mod_evhost",
    "mod_compress",
    "mod_cgi",
    "mod_fastcgi",
    "mod_dirlisting",
    "mod_staticfile",
    # 11
)

-- ecook

Updated by stbuehler about 1 year ago

I did not try if the patches are working (I don't use mod_compress), so please report if it works for you.

Updated by stut about 1 year ago

Was having the same problem here on 1.4.18 - can confirm that the attached patch for 1.4 works.

Updated by Anonymous about 1 year ago

mkdir_recursive will cause segfault while creating something like "/dir1/" (with trailing slash).


while ((p = strchr(p + 1, '/')) != NULL) {

must be


while ((*p) && (p = strchr(p + 1, '/')) != NULL)) { 

Updated by stbuehler about 1 year ago

+ Duplicate of #230

Updated by Anonymous about 1 year ago

please fix! this is a huge annoyance.

Updated by stbuehler about 1 year ago

Fixed in r2081 for 1.4.x

Updated by spillgroup about 1 year ago

I've attached a slightly modified version for 1.4.18 which is a bit smarter with mkdir's. The previous behaviour was to try and mkdir every part of a file's patch on every access (even when already in the cache). This patch moves the mkdir's to after the place where it checks for existence.

Updated by stbuehler about 1 year ago

  • Status changed from New to Fixed
  • Resolution set to fixed

Fixed in r2135 for lighty-1.5.x with optimization - i hope it works ;-)

Also available in: Atom PDF