2014-07-13 20:25:30 +08:00
Debian
======
2016-07-03 18:21:13 +08:00
.. contents ::
Easy Way: Debian Jessie
-----------------------
2016-07-05 05:15:01 +08:00
**Step 1:** Setup Sudo
2016-07-03 18:21:13 +08:00
By default Debian does not come with sudo. Log in as root or use su command.
N.B. The instructions below are for setting up sudo for your current account, you can
do this as root if you prefer.
::
2016-07-05 21:10:03 +08:00
apt-get update
apt-get install sudo
2016-07-03 18:21:13 +08:00
usermod -a -G sudo <username>
exit
Logout or try `` newgrp `` to reload user groups
2016-07-05 05:15:01 +08:00
**Step 2:** Run sudo and update
2016-07-03 18:21:13 +08:00
Now run session using sudo and ensure system is updated.
::
sudo -i
2016-07-05 21:10:03 +08:00
apt-get upgrade
2016-07-03 18:21:13 +08:00
2016-07-05 05:15:01 +08:00
**Step 3:** Install Apache and MySQL
2016-07-03 18:21:13 +08:00
These are not dependencies for the package as they could
be installed elsewhere.
::
2016-07-05 21:10:03 +08:00
apt-get install apache2 mysql-server
2016-07-03 18:21:13 +08:00
2016-07-05 05:15:01 +08:00
**Step 4:** Edit sources.list to add jessie-backports
2016-07-03 18:21:13 +08:00
::
nano /etc/apt/sources.list
Add the following to the bottom of the file
::
# Backports repository
deb http://httpredir.debian.org/debian jessie-backports main contrib non-free
CTRL+o and <Enter> to save
CTRL+x to exit
2016-07-05 05:15:01 +08:00
**Step 5:** Install ZoneMinder
2016-07-03 18:21:13 +08:00
::
2016-07-05 21:10:03 +08:00
apt-get update
apt-get install zoneminder
2016-07-03 18:21:13 +08:00
2016-07-05 05:15:01 +08:00
**Step 6:** Read the Readme
2016-07-03 18:21:13 +08:00
The rest of the install process is covered in the README.Debian, so feel free to have
a read.
::
gunzip /usr/share/doc/zoneminder/README.Debian.gz
cat /usr/share/doc/zoneminder/README.Debian
2016-07-05 05:15:01 +08:00
**Step 7:** Setup Database
2016-07-03 18:21:13 +08:00
Install the zm database and setup the user account. Refer to Hints in Ubuntu install
should you choose to change default database user and password.
::
cat /usr/share/zoneminder/db/zm_create.sql | sudo mysql --defaults-file=/etc/mysql/debian.cnf
echo 'grant lock tables,alter,create,select,insert,update,delete,index on zm.* to 'zmuser'@localhost identified by "zmpass";' | sudo mysql --defaults-file=/etc/mysql/debian.cnf mysql
2016-07-05 05:15:01 +08:00
** Step 8:** zm.conf Permissions
2016-07-03 18:21:13 +08:00
Adjust permissions to the zm.conf file to allow web account to access it.
::
chgrp -c www-data /etc/zm/zm.conf
2016-07-05 05:15:01 +08:00
**Step 9:** Setup ZoneMinder service
2016-07-03 18:21:13 +08:00
2014-07-13 20:25:30 +08:00
::
2016-07-03 18:21:13 +08:00
systemctl enable zoneminder.service
2014-07-13 20:25:30 +08:00
2016-07-05 05:15:01 +08:00
**Step 10:** Configure Apache
2016-07-03 18:21:13 +08:00
The following commands will setup the default /zm virtual directory and configure
required apache modules.
2014-07-13 20:25:30 +08:00
::
2016-07-03 18:21:13 +08:00
a2enconf zoneminder
a2enmod cgi
a2enmod rewrite
2014-07-13 20:25:30 +08:00
2016-07-05 05:15:01 +08:00
**Step 11:** Edit Timezone in PHP
2014-07-13 20:25:30 +08:00
::
2016-07-03 18:21:13 +08:00
nano /etc/php5/apache2/php.ini
2016-07-05 21:10:03 +08:00
Search for [Date] (Ctrl + w then type Date and press Enter) and change
2016-07-03 18:21:13 +08:00
date.timezone for your time zone. **Don't forget to remove the ; from in front
of date.timezone**
2014-07-13 20:25:30 +08:00
::
2016-07-03 18:21:13 +08:00
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York
CTRL+o then [Enter] to save
CTRL+x to exit
2016-07-05 05:15:01 +08:00
**Step 12:** Start ZoneMinder
2016-07-03 18:21:13 +08:00
Reload Apache to enable your changes and then start ZoneMinder.
::
2016-07-05 05:15:01 +08:00
systemctl reload apache2
systemctl start zoneminder
2016-07-03 18:21:13 +08:00
2016-07-05 05:15:01 +08:00
**Step 13:** Making sure ZoneMinder works
2016-07-03 18:21:13 +08:00
1. Open up a browser and go to `` http://hostname_or_ip/zm `` - should bring up ZoneMinder Console
2. (Optional API Check)Open up a tab in the same browser and go to `` http://hostname_or_ip/zm/api/host/getVersion.json ``
If it is working correctly you should get version information similar to the example below:
::
{
"version": "1.29.0",
"apiversion": "1.29.0.1"
}
2014-07-13 20:25:30 +08:00
2016-07-03 18:21:13 +08:00
**Congratulations** Your installation is complete