How to install Zoneminder 1.29.0 on Ubuntu 16.04

Open the Ubuntu terminal

sudo su

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

rm /etc/mysql/my.cnf  

cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf
gedit /etc/mysql/my.cnf

add the following line at 32

sql_mode = NO_ENGINE_SUBSTITUTION

Screenshot from 2016-04-23 21-38-28

Then save my.cnf

systemctl restart mysql

Install Zoneminder

Install Synaptic package manager using Ubuntu Software Center

Then install Zoneminder 29.1.0 using the Synaptic package manager

(Ubuntu Software Center in Ubuntu 16.04 does not have Zoneminder)

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

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
mysqladmin -uroot -p reload

 

chmod 740 /etc/zm/zm.conf

chown root:www-data /etc/zm/zm.conf
adduser www-data video
a2enmod cgi
a2enconf zoneminder
a2enmod rewrite
chown -R www-data:www-data /usr/share/zoneminder/
systemctl enable zoneminder

service zoneminder start

Add timezone to PHP

gedit /etc/php/7.0/apache2/php.ini
 
edit line 912 with your timezone

Screenshot from 2016-04-23 21-40-45
Then save the file php.ini

Your time zone can be get from here 


service apache2 reload

Open Zoneminder http://localhost/zm/
 Referance Zoneminder Wiki

Advertisements

10 thoughts on “How to install Zoneminder 1.29.0 on Ubuntu 16.04

  1. Hi BK

    I just installed Ubuntu 16.04 and did the up grades. Then when I copied and pasted these lines

    “rm /etc/mysql/my.cnf

    cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf”

    it returns “no such file exists.

    Then when I copy and paste “gedit /etc/mysql/my.cnf” i get an empty file.

    Any idea what’s up?? I installed Ubuntu 16.04 Desktop. Do I need to be using 16.04 Server.??

    Thanks.

    PS I have been using your tutorial for installing Zonemider on Ubuntu 14.04 Desktop and that works every time.

  2. Hi

    Solved the problem of

    “I just installed Ubuntu 16.04 and did the up grades. Then when I copied and pasted these lines

    “rm /etc/mysql/my.cnf

    cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf”

    it returns “no such file exists.

    Then when I copy and paste “gedit /etc/mysql/my.cnf” i get an empty file.

    Any idea what’s up?? I installed Ubuntu 16.04 Desktop. Do I need to be using 16.04 Server.?? ”

    It seems that doing a brand new install there is no //etc/mysql/my.conf file. It doesn’t exist yet. But if your up-grading your ZM or reinstalling because you made an error then you need to run the lines

    “rm /etc/mysql/my.cnf

    cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf”.

    ZM 1.29.0 run perfectly now.

    One other thing. I couldn’t use gedit to set the timezone. It kept returning errors. I switched to nano and edited the PHP files with no problems.

    Thanks for the tutorials on installing ZM.

  3. I have followed the Zoneminder installation instructions but get the following when I try to run it:-

    Cannot write to content dirs(‘events’,’images’). Check that these exist and are owned by the web account user

    Any advice on how to correct this would be appreciated.

    • Tony:

      I had the same problem.

      sudo su

      chown -R www-data:www-data /var/cache/zoneminder

      That fixed the problem for me.

      MMM

    • Sorry if this is a duplicate, but I didn’t see the first try.

      Tony:

      I had the same problem. It was fixed by:

      sudo su
      chown -R www-data:www-data /var/cache/zoneminder

      That is strangely similar to the same line that ends in /usr/share/zoneminder in the original instructions.

      MMM

  4. I need help! I followed the WIKI instructions and had problems with the password for mysql etc so followed the upgrade to maria and that seemed to go smoothly until I tried to start the zoneminder service and I get this: service zoneminder start
    Job for zoneminder.service failed because the control process exited with error code. See “systemctl status zoneminder.service” and “journalctl -xe” for details

    the systemctl status says this:
    zoneminder.service – ZoneMinder CCTV recording and surveillance system
    Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Sat 2016-11-26 22:26:14 PST; 2min 17s ago
    Process: 3233 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=255)

    Nov 26 22:26:14 Keidel-upstairs-desk zmpkg.pl[3233]: Can’t execute: Table ‘zm.Config’ doesn’t exist at /usr/share/perl5/ZoneMinder/Config
    Nov 26 22:26:14 Keidel-upstairs-desk zmpkg.pl[3233]: BEGIN failed–compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 119.
    Nov 26 22:26:14 Keidel-upstairs-desk zmpkg.pl[3233]: Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
    Nov 26 22:26:14 Keidel-upstairs-desk zmpkg.pl[3233]: BEGIN failed–compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
    Nov 26 22:26:14 Keidel-upstairs-desk zmpkg.pl[3233]: Compilation failed in require at /usr/bin/zmpkg.pl line 48.
    Nov 26 22:26:14 Keidel-upstairs-desk zmpkg.pl[3233]: BEGIN failed–compilation aborted at /usr/bin/zmpkg.pl line 48.
    Nov 26 22:26:14 Keidel-upstairs-desk systemd[1]: zoneminder.service: Control process exited, code=exited status=255
    Nov 26 22:26:14 Keidel-upstairs-desk systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system.
    Nov 26 22:26:14 Keidel-upstairs-desk systemd[1]: zoneminder.service: Unit entered failed state.
    Nov 26 22:26:14 Keidel-upstairs-desk systemd[1]: zoneminder.service: Failed with result ‘exit-code’.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s