Skip to content

Instantly share code, notes, and snippets.

@kylejohnson kylejohnson/default
Last active Sep 12, 2019

Embed
What would you like to do?
Ubuntu 16.04.1 ZoneMinder Source Install
server {
listen 80 default_server;
server_name _;
root /var/www/zm;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location /cgi-bin/nph-zms {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/nph-zms;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location /api/ {
rewrite ^/api(.+)$ /api/index.php?p=$1 last;
}
}
# Future notes for self
# Host mysql in separate freebsd jail
# tune zfs datasets accordingly
# https://www.patpro.net/blog/index.php/2014/03/09/2617-mysql-on-zfs-on-freebsd/
# https://blogs.oracle.com/realneel/entry/mysql_innodb_zfs_best_practices
sudo apt-get install php php-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm subversion automake autoconf libjpeg-turbo8-dev libjpeg-turbo8 php-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev wget git-core mysql-client cmake build-essential libpolkit-backend-1-dev libcurl3 libavfilter-dev libavformat-dev libavutil-dev libswscale-dev libavformat-dev libavutil-dev libavdevice-dev libcurl4-gnutls-dev libgnutls-dev libvlc-dev libgcrypt-dev mysql-server nginx-extras fcgiwrap php-fpm libsys-meminfo-perl libsys-cpu-perl
git clone https://github.com/ZoneMinder/ZoneMinder.git
cd ZoneMinder
git submodule init
git submodule update --init --recursive
cmake -DZM_WEBDIR=/var/www/zm -DZM_CGIDIR=/usr/lib/cgi-bin -DZM_WEB_USER=www-data -DZM_WEB_GROUP=www-data -DZM_DB_USER=zm01 -DZM_DB_PASS=zm01 -DZM_DB_HOST=localhost -DZM_DB_NAME=zm01
make
sudo make install
mysql -u zm01 -p < db/zm_create.sql
# Copy over zoneminder.service to /etc/systemd/system/
# date.timezone = America/Denver in /etc/php/7.0/fpm/php.ini
mkdir /var/www/zm/{events,images}
chown -R www-data:www-data /var/www/zm/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.