TUTORIAL: ZoneMinder 1.32.X on Ubuntu 18.04 with LEMP
Posted: Wed Jan 09, 2019 6:01 am
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.
You must also update the ZM_PATH_ZMS in the 01-system-paths.conf file to /cgi-bin/nph-zms by dropping the /zm/
Then, use the following location code block for NGiNX. This is assuming you already have a proper server block setup.
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.
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
Code: Select all
sudo nano /etc/zm/conf.d/01-system-paths.conf
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;
}
}
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.