TUTORIAL: ZoneMinder 1.32.X on Ubuntu 18.04 with LEMP

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
terdinglage
Posts: 11
Joined: Thu Jan 03, 2019 7:14 am

TUTORIAL: ZoneMinder 1.32.X on Ubuntu 18.04 with LEMP

Post by terdinglage »

Just in case anyone out there is looking for this, I was able to piece together a working LEMP install for Zoneminder 1.32.X on Ubuntu 18.04 with a Let's Encrypt NGiNX reverse proxy. This uses zmauth and not basic auth, and works fine with zmNinja as well. Special thanks to Nocifer for his help, the majority of this work was based on his working location configs from this forum thread: viewtopic.php?f=38&t=27633

You can follow the same general install steps for LEMP from the previous tutorials put together by bbunge, but make sure to install ZoneMinder 1.32 from the iconner PPA.

Code: Select all

sudo add-apt-repository ppa:iconnor/zoneminder-1.32
You must also update the ZM_PATH_ZMS in the 01-system-paths.conf file to /cgi-bin/nph-zms by dropping the /zm/

Code: Select all

sudo nano /etc/zm/conf.d/01-system-paths.conf
Then, use the following location code block for NGiNX. This is assuming you already have a proper server block setup.

Code: Select all

location /cgi-bin {
auth_basic off;

	alias /usr/lib/zoneminder/cgi-bin;     
	include fastcgi_params;
	fastcgi_param SCRIPT_FILENAME $request_filename;
	fastcgi_param HTTP_PROXY "";
	fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
        
location /zm/cache {
auth_basic off;

        alias /var/cache/zoneminder/cache;
}

location ~ /zm/api/(css|img|ico) {
auth_basic off;

	rewrite ^/zm/api(.+)$ /api/app/webroot/$1 break;
	try_files $uri $uri/ =404;
}

location /zm {
auth_basic off;

	alias /usr/share/zoneminder/www;
	try_files $uri $uri/ /index.php?$args =404;    

	location /zm/api {
auth_basic off;

		rewrite ^/zm/api(.+)$ /zm/api/app/webroot/index.php?p=$1 last;
	}
    
		location ~ \.php$ {
		
		auth_basic off;
			
			include fastcgi_params;
			fastcgi_param SCRIPT_FILENAME $request_filename;
			fastcgi_param HTTP_PROXY "";
               	fastcgi_index index.php;
        		fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        }
    }
Finally, if you want to use zmauth and zmninja, you need to go to do the following:

1. Options -> System -> OPT_USE_AUTH -> Checked
2. Options -> System -> AUTH_RELAY -> None
3. Options -> System -> AUTH_HASH_LOGINS -> Checked

I would greatly appreciate input from someone on the forums if selecting none for AUTH_RELAY is a security issue. To complete your zmNinja install, you may also need to /cgi-bin from /zm/cgi-bin as well.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: TUTORIAL: ZoneMinder 1.32.X on Ubuntu 18.04 with LEMP

Post by bbunge »

Two thumbs up for this one! Will get to work on teh WIKI this afternoon.

bb
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: TUTORIAL: ZoneMinder 1.32.X on Ubuntu 18.04 with LEMP

Post by bbunge »

Post Reply