zoneminder and lighttp

Forum for questions and support relating to the 1.31.x releases only.
Locked
aelg305
Posts: 3
Joined: Fri Sep 29, 2017 5:10 pm

zoneminder and lighttp

Post by aelg305 »

I have:
  • Raspberry PI 3
    Debian stretch
    I have successfully installed before zoneminder along with apache.... however, I need lighttp
    I did a new install and got my website working (https) however, ZM does not work....
Anything with # I have omitted from my installation.... help! I'll update these steps so anybody else can follow them if I get it to work.



my steps:
https://wiki.zoneminder.com/Debian_9_64 ... e_Easy_Way
https://bkjaya.wordpress.com/2016/11/23 ... sy-64-bit/

#add stretch-backports:
sudo nano /etc/apt/sources.list
deb http://archive.raspbian.org/raspbian/ stretch main
deb http://www.deb-multimedia.org stretch main non-free
deb http://ftp.debian.org/debian stretch-backports main

#if else fails:
sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list

sudo aptitude install debian-keyring debian-archive-keyring
sudo apt update && apt-get source
sudo apt install deb-multimedia-keyring

# -If apt-get can not find the new key, do that :
wget http://www.deb-multimedia.org/pool/main ... .1_all.deb
sudo dpkg -i deb-multimedia-keyring_2016.8.1_all.deb

sudo apt-get update && sudo apt-get upgrade && sudo apt dist-upgrade && sudo apt-get clean && sudo apt-get autoremove
sudo apt-get -t stretch-backports install "package"

-give priority to backports - not doing this one:
# sudo nano /etc/apt/preferences.d/zoneminder
#
# add:
# Package: *
# Pin: origin http.debian.net
# Pin-Priority: 1100

sudo apt-get update
sudo apt upgrade
sudo apt dist-upgrade

( lighttp is already installed at this point!)
sudo chown www-data:www-data /var/www/html/ -R

#install database mariadb:
sudo apt install mariadb-server php-mysql apache2-mod-php7.0 php-fpm php-pdo mariadb-client
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation

#install PHPMyAdmin (select NO for dbconfig-common):
sudo apt -y install phpmyadmin php-mbstring php-gettext


#fix password for phpmyadmin:
sudo mysql -u root -p mysql
update user set plugin='' where user='root';
flush privileges;
exit

#following the instructions for the database creation:
sudo rm /etc/mysql/my.cnf
sudo cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf
sudo nano nano /etc/mysql/my.cnf

#Make the following changes:
character-set-server = latin1
collation-server = latin1_swedish_ci

sudo service mariadb restart
/etc/init.d/lighttpd start


#create access for zoneminder:
mysql -u root -p mysql> grant select,insert,update,delete,lock tables,alter,create on zm.* to 'zmuser'@localhost identified by 'YOURPASSWORDHERE';
cat /usr/share/zoneminder/db/zm_create.sql | sudo mysql --defaults-file=/etc/mysql/debian.cnf


#create a database:
mysql> create database zm;
mysql> CREATE USER zmuser@localhost IDENTIFIED BY 'YOURPASSWORDHERE';
mysql> grant CREATE, INSERT, SELECT, DELETE, UPDATE, DROP on zm.* to zmuser@localhost;


#update:
sudo nano /etc/zm.conf

#with values from above


sudo chown www-data.www-data /etc/zm.conf

#Install ZoneMinder:
sudo apt install zoneminder vlc-plugin-base php7.0-gd
sudo apt purge apache2

#Set permissions of /etc/zm/zm.conf to root:www-data 740
sudo chmod 740 /etc/zm/zm.conf
sudo chown root:www-data /etc/zm/zm.conf
sudo systemctl enable zoneminder.service
sudo adduser www-data video
sudo systemctl start zoneminder.service


# not sure about this step since Im not using apache: create link for apache (paths can differ):
#sudo ln -s /etc/zm/apache.conf /etc/apache2/conf-available/zoneminder.conf
#
#-Configure Apache, enable to boot at start, and start zm:
#sudo a2enmod cgi
#sudo a2enmod rewrite
#sudo a2enconf zoneminder
sudo chown -R www-data:www-data /usr/share/zoneminder/


#-Edit Timezone in PHP:
sudo nano /etc/php/7.0/apache2/php.ini

#-Search for [Date]
date.timezone = America/New_York


#-Edit lighttpd to work with zm:
sudo nano /etc/lighttpd/lighttpd.conf

alias.url = ( "/zm" => "/usr/share/zoneminder/" )

alias.url += ( "/cgi-bin" => "/usr/lib/cgi-bin/" )

#-Start lighttpd
/etc/init.d/lighttpd start


#-edit ZM:
sudo nano /etc/zm.conf

#should look like this:
# Username and group that web daemon (httpd/apache) runs as
ZM_WEB_USER=www-data
ZM_WEB_GROUP=www-data


#-enable mod cgi:
sudo lighttpd-enable-mod cgi
sudo service lighttpd force-reload



#-Making sure ZoneMinder works:
#-Open browser: http://hostname_or_ip/zm
#-API Check): http://hostname_or_ip/zm/api/host/getVersion.json

Should get:
"version": "1.29.0",
"apiversion": "1.29.0.1"


#-Once withint the GUI:
-Click: Options
Check: Check with zoneminder.com for updated versions (?) click Save

-Click Images tab
Check Is the (optional) cambozola java streaming client installed (?) Click Save

#-Click Paths
#Change PATH_ZMS from /cgi-bin/nph-zms to /zm/cgi-bin/nph-zms Click Save

Optional: under Paths change PATH_SWAP to /dev/shm (puts this process in RAM drive) Click Save
Restart Zoneminder
Your Zoneminder install is now ready to add cameras!


-Check memory usage:
http://zoneminder.readthedocs.io/en/stable/faq.html

df -h|grep "Filesystem\|shm"

should show (% below 70% ok / over = no bueno):
Filesystem Size Used Avail Use% Mounted on
tmpfs 2.6G 923M 1.7G 36% /dev/shm




SETUP CAMERAS:

SETUP ZONES:
https://wiki.zoneminder.com/index.php/U ... or_Dummies?

ADD EMAIL NOTIFICATIONS:
http://www.zoneminder.com/wiki/index.ph ... Zoneminder

LIMIT HARD DRIVE USE:
http://zoneminder.readthedocs.io/en/stable/faq.html
Locked