Lighttpd

From ZoneMinder Wiki
Revision as of 09:45, 3 November 2024 by Creature (talk | contribs) (Add an example config for working with Lighttpd)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Zoneminder comes with an Apache configuration file for the web interface, but it's possible to run the web interface with Lighttpd too.

The web interface has several different parts. On Ubuntu:

  • The main interface is located in /usr/share/zoneminder/www/.
  • Zoneminder compiles its supporting assets (ie. CSS and images) into /var/cache/zoneminder/cache/.
  • Live camera views are handled via CGI-bin through the supporting programs in /usr/lib/zoneminder/cgi-bin/.

This helps with troubleshooting: for instance, if the web interface appears but doesn't look like screenshots in the manual, you should double-check the cache settings. The access and error logs in /var/log/lighttpd/ will help narrow down the problem too.

This config works for me on Ubuntu 22.04.5, Zoneminder 1.36.35, and Lightttpd 1.4.63:

# These modules support URL rewriting and CGI processes.
server.modules += (
    "mod_alias",
    "mod_cgi"
)

# Rewrite API calls to point to the API PHP entrypoint.
url.rewrite += (
    "^/zm/api(.+)$"  => "/zm/api/index.php"
)

# These paths match the default Ubuntu 20.04 locations; double-check them if you have problems. 
alias.url += (
    "/zm/cache" => "/var/cache/zoneminder/cache",
    "/zm/api" => "/usr/share/zoneminder/www/api/app/webroot/",
    "/zm/cgi-bin" => "/usr/lib/zoneminder/cgi-bin/",
    "/zm/" => "/usr/share/zoneminder/www/",
    "/cgi-bin" => "/usr/lib/cgi-bin/"
)

# The default Zoneminder CGI script is a symlink, so Lighttpd must follow symlinks.
server.follow-symlink = "enable"
$HTTP["url"] =~ "^/zm/cgi-bin" {
    cgi.assign = ("" => "")
}