Difference between revisions of "Raspbian"

From ZoneMinder Wiki
Jump to navigationJump to search
(Created page with "A special Thanks to "Felixr" and "BBungle" from witch I took the initial FAQ. This tutorial is created for a Raspberry PI 1 and 2 running Raspbian Jessie Prereq before start...")
 
Line 12: Line 12:
  su root  (followed by your root password)
  su root  (followed by your root password)


Configure your network
Configure your network Set static IP address
 
Set static IP address


   nano /etc/network/interfaces
   nano /etc/network/interfaces


Make changes similar to this:
Make changes similar to this:


  auto eth0
auto eth0
    
    
  #allow-hotplug eth0 (make sure this is commented or you will get 2 ip's)
#allow-hotplug eth0 (make sure this is commented or you will get 2 ip's)
  iface eth0 inet static
iface eth0 inet static
    address 192.168.1.10
  address 192.168.1.10
    netmask 255.255.255.0
  netmask 255.255.255.0
    gateway 192.168.1.1
  gateway 192.168.1.1
    dns-nameservers 192.168.1.1
  dns-nameservers 192.168.1.1


Update Raspbian Sources
Update Raspbian Sources

Revision as of 17:41, 11 November 2015

A special Thanks to "Felixr" and "BBungle" from witch I took the initial FAQ.

This tutorial is created for a Raspberry PI 1 and 2 running Raspbian Jessie

Prereq before starting: - SD card created with raspbian Jessie 64bit - filesystem is extended. - the systems boots in console mode (X is disabled)

Log in as root

su root  (followed by your root password)

Configure your network Set static IP address

 nano /etc/network/interfaces

Make changes similar to this:

auto eth0
 
#allow-hotplug eth0 (make sure this is commented or you will get 2 ip's)
iface eth0 inet static
  address 192.168.1.10
  netmask 255.255.255.0
  gateway 192.168.1.1
  dns-nameservers 192.168.1.1

Update Raspbian Sources

apt-get update

Check to be sure everything is up to date for the raspbian distribution

apt-get upgrade
apt-get dist-upgrade

Add the Jessie backports

nano /etc/apt/sources.list

add to the top of the list:

deb http://http.debian.net/debian jessie-backports main

Ctrl+o Enter to save CTRL+x to exit

add priority to this repository

nano /etc/apt/preferences.d/zoneminder

add to the file:

Package: *
Pin: origin http.debian.net
Pin-Priority: 1100

Ctrl+o Enter to save CTRL+x to exit

Update Sources

Install PHP, and MySQL server (This installs MySQL server 5.5. If you want to use MySQL 5.6 follow the instructions Install MySQL 5.6 on Debian Jessie (using mariadb also works fine, as tested on Debian 8.2, replacement package for mysql-server is then mariadb-server)

apt-get install  php5 mysql-server php-pear php5-mysql


Update Sources

apt-get update

Check to be sure everything is up to date

apt-get upgrade
apt-get dist-upgrade


Reboot server if needed

Install Zoneminder

apt-get install zoneminder


You may need to install "extra" VLC components (I will check this and edit as needed)

apt-get install libvlc-dev libvlccore-dev vlc

Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)

This next step creates a file which contained the MySQL user and password. Otherwise you will have to enter the user and password on the command line which is not secure!

Go to the root directory

cd ~

Create a hidden password file

nano .my.cnf

Enter this content (but use your MySQL root password!)

[client]
user=root
password=(mysqlpass)

Ctrl+o Enter to save

CTRL+x to exit

Create database (press ENTER after each command)

mysql < /usr/share/zoneminder/db/zm_create.sql 
mysql -e "grant select,insert,update,delete,create on zm.* to 'zmuser'@localhost identified by 'zmpass';"

Remove password file

rm .my.cnf

Set permissions of /etc/zm/zm.conf to root:www-data 740

chmod 740 /etc/zm/zm.conf

chown root:www-data /etc/zm/zm.conf

Enable Zoneminder service to start at boot

systemctl enable zoneminder.service

Add www-data to the sudo group (to enable use of local video devices)

adduser www-data video

Start Zoneminder

systemctl start zoneminder.service

Check to see that Zoneminder is running

systemctl status zoneminder.service

Enable CGI and Zoneminder configuration in Apache.

a2enmod cgi

a2enconf zoneminder

Restart Apache

service apache2 restart
      • You may be tempted to try Zoneminder at this point but there is one setting you will need to change from the web gui. Read on!!!

Optional: Install Cambozola (needed if you use Internet Explorer)

cd /usr/src && wget http://www.andywilcock.com/code/cambozola/cambozola-latest.tar.gz
tar -xzvf cambozola-latest.tar.gz
replace 936 with cambozola version downloaded
cp cambozola-0.936/dist/cambozola.jar /usr/share/zoneminder

You should now be able to access the web server using http://servername


Open Zoneminder in web browser

http://serverip/zm

Click Options

Uncheck: 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!