Note: the links for the files in Google drive have changed. See:
viewtopic.php?f=36&t=27783
Not gone completely. If you look at the history for that link you can find:
Ubuntu 18.04 LEMP (NGNIX, Mariadb, PHP)
Start with a basic Ubuntu 18.04 install. You can use a server or desktop install. Do not install LAMP!
Become root
sudo su
Install Ngnix, Mariadb and PHP components
apt install nginx mariadb-server php-fpm php-mysql fcgiwrap
Secure the Mariadb server
mysql_secure_installation
Restart Mariadb
systemctl restart mysql
Edit the php.ini file
nano /etc/php/7.2/fpm/php.ini
Locate (Ctrl+w) cgi.fix_pathinfo=1 and change to
cgi.fix_pathinfo=0
Remember to remove the leading ;
Also fix date. Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Make sure to remove the ; from the front of date.timezone
[Date]
; Defines the default timezone used by the date functions
;
http://php.net/date.timezone
date.timezone = America/New_York
Ctrl+o Enter to save
CTRL+x to exit
Restart php-fpm
systemctl restart php7.2-fpm
Download the Zoneminder install package. This may take a minute to connect
wget --no-check-certificate '
https://docs.google.com/uc?export=downl ... zwtOcCiisX' -O /tmp/zoneminder-1.30.4-bionic-amd64.deb
Install Zoneminder
apt install /tmp/zoneminder-1.30.4-bionic-amd64.deb
Create a new user
adduser www-data video
Fix Permissions
chown -R www-data:www-data /usr/share/zoneminder/
Enable and start Zoneminder
systemctl enable zoneminder
service zoneminder start
Edit the Ngnix default configuration.
nano /etc/nginx/sites-available/default
Locate the line "index index.html index.htm index.nginx-debian.html;" and add index.php
index index.php index.html index.htm index.nginx-debian.html;
Ctrl+o Enter to save
CTRL+x to exit
Create a Zoneminder conf file
nano /etc/nginx/zoneminder.conf
Enter the following into the zoneminder.conf file (This file was improved by databoy2k)
location /zm/cgi-bin {
gzip off;
alias /usr/lib/zoneminder/cgi-bin;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location /zm {
# if ($scheme ~ ^http:){
# rewrite ^(.*)$ https://$host$1 permanent;
# }
gzip off;
alias /usr/share/zoneminder/www;
index index.php;
location ~ \.php$ {
if (!-f $request_filename) { return 404; }
expires epoch;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ \.(jpg|jpeg|gif|png|ico)$ {
access_log off;
expires 33d;
}
location /zm/api/ {
alias /usr/share/zoneminder/www/api;
rewrite ^/zm/api(.+)$ /zm/api/index.php?p=$1 last;
}
}
Ctrl+o Enter to save
CTRL+x to exit
Edit the default sites enabled
nano /etc/nginx/sites-enabled/default
In the "server" section after listen [::] :80 default_Server; add
include /etc/nginx/zoneminder.conf;
Ctrl+o Enter to save
CTRL+x to exit
Restart Ngnix
service nginx restart
Note: If Nginx gives you an error on restart go back one step and re-enter include /etc/ngnix/zoneminder.conf;
IMPORTANT FINAL STEP: Open Zoneminder in a web browser (
http://server-ip/zm). Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms
Note: 01JUL18 There is currently an issue getting this configuration to view monitors in Montage. The previous recommendation to modify the fcgiwrap config did not work. Will investigate as time permits but if you need a system that works install Mariadb, Apache, PHP and Zoneminder.