Frontend Errors www/cache files not found

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
paulb73
Posts: 3
Joined: Fri Oct 19, 2018 11:22 am

Frontend Errors www/cache files not found

Post by paulb73 »

Hi Folks

I've been struggling for a few days to get Zoneminder working. I'm running Lubuntu 18.10 64bit:

Code: Select all

Linux rogue 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
and I'm using Nginx instead of Apache as I'm looking for a lighter footprint from the web server.

I followed the instructions here https://chiralsoftware.com/idea/nginx-u ... zoneminder to configure Nginx for Zoneminder and all seemed to go well. If I access http://my.server.ip.addr/zoneminder/ I can see the console. However the add monitor button doesn't do anything and the options screen layout is broken. Looking in the web server error log I found a lot of file not found errors similar to those below all relating to /usr/share/zoneminder/www/cache.

Code: Select all

2018/10/19 12:15:16 [error] 504#504: *42 open() "/usr/share/zoneminder/www/cache/skins_classic_css_classic_views_options-classic-1539910494.css" failed (2: No such file or directory), client: 192.168.1.22, server: 192.168.1.7, request: "GET /zoneminder/cache/skins_classic_css_classic_views_options-classic-1539910494.css HTTP/1.1", host: "192.168.1.7", referrer: "http://192.168.1.7/zoneminder/index.php?view=options"
2018/10/19 12:15:16 [error] 504#504: *45 open() "/usr/share/zoneminder/www/cache/skins_classic__js_jquery-ui-1.12.1_jquery-ui.structure.min-classic-1539910494.css" failed (2: No such file or directory), client: 192.168.1.22, server: 192.168.1.7, request: "GET /zoneminder/cache/skins_classic__js_jquery-ui-1.12.1_jquery-ui.structure.min-classic-1539910494.css HTTP/1.1", host: "192.168.1.7", referrer: "http://192.168.1.7/zoneminder/index.php?view=options"
2018/10/19 12:15:16 [error] 504#504: *39 open() "/usr/share/zoneminder/www/cache/skins_classic__css_classic_jquery-ui-theme-classic-1539910494.css" failed (2: No such file or directory), client: 192.168.1.22, server: 192.168.1.7, request: "GET /zoneminder/cache/skins_classic__css_classic_jquery-ui-theme-classic-1539910494.css HTTP/1.1", host: "192.168.1.7", referrer: "http://192.168.1.7/zoneminder/index.php?view=options"
2018/10/19 12:15:16 [error] 504#504: *44 open() "/usr/share/zoneminder/www/cache/skins_classic_js_classic-classic-1539910494.js" failed (2: No such file or directory), client: 192.168.1.22, server: 192.168.1.7, request: "GET /zoneminder/cache/skins_classic_js_classic-classic-1539910494.js HTTP/1.1", host: "192.168.1.7", referrer: "http://192.168.1.7/zoneminder/index.php?view=options"
2018/10/19 12:15:16 [error] 504#504: *41 open() "/usr/share/zoneminder/www/cache/skins_classic_js_skin-classic-1539910494.js" failed (2: No such file or directory), client: 192.168.1.22, server: 192.168.1.7, request: "GET /zoneminder/cache/skins_classic_js_skin-classic-1539910494.js HTTP/1.1", host: "192.168.1.7", referrer: "http://192.168.1.7/zoneminder/index.php?view=options"
Looking under /usr/share/zoneminder/www the cache directory was absent. I created it, changed the perms to the user running the web server and restarted zonemonitor, but no dice.

Anyone have any clue what I've missed?

Cheers
Paul
paulb73
Posts: 3
Joined: Fri Oct 19, 2018 11:22 am

Re: Frontend Errors www/cache files not found

Post by paulb73 »

Small update. I've located the missing files in /var/cache/zoneminder/cache so this is presumably a path issue. Can anyone point to where this might be configured? I'm guessing a symlink might be a workaround but I'd like to fix it properly.

EDIT - Yes a symlink sorts it and I can now create a monitor and view video (after fixing PATH_ZMS). I'd still like to work out a proper fix so any ideas are welcome!

Ta
Paul
Nocifer
Posts: 37
Joined: Mon Oct 01, 2018 4:05 pm

Re: Frontend Errors www/cache files not found

Post by Nocifer »

It's because you haven't configured a /cache location block in ZM's Nginx conf file. To fix it you can use the conf file I've linked below, either as a reference to create a /cache block in your own conf, or by replacing it altogether. Keep in mind that in the latter case you'll have to skim through it and make sure the various paths are correct for your setup (it uses the default paths of ZM 1.32.2 for Ubuntu 18.04, installed from iconnor's ppa).

Reading the provided conf file at the link you mentioned in your post, there are so many things wrong with it that I'd say just overwrite and be done with it. Just make sure you back up your current conf first, in case something goes wrong.

https://pastebin.com/pUSDWiFM

Edit: Just for reference, yes, a link under /www/ can fix the issue as well, and it may even be a better (as in cleaner) solution than creating an extra alias in the conf file. But this would mean that, unless ZM's people make their official scripts create this link automatically during setup, then the users would need to mess around manually with ZM's folder structure, like you did, which could (in theory at least) lead to security issues down the road. So making the change inside the web server's conf file, which is already supposed to be user editable, achieves the same result without the potential side-effects.
paulb73
Posts: 3
Joined: Fri Oct 19, 2018 11:22 am

Re: Frontend Errors www/cache files not found

Post by paulb73 »

Thanks for the reply. I figured it out yesterday after finding your Nginx Config file in the forum - many thanks for that. After a bit of experimentation I’ve now got a working config including api access.
Post Reply