Ubuntu 16.04 Release with Zoneminder 1.29.0

Forum for questions and support relating to the 1.29.x releases only.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

I have verified the "Easy" Zoneminder 1.29.0 install procedure on the released Ubuntu 16.04 LTS!

https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

Please be aware that you will have to make some configuration changes to Apache and MySQL. These steps are included in the procedure.

I have completed and tested the procedure to upgrade MySQL 5.7 to Mariadb 10. The cleanest way to do this is before installing Zoneminder but there is a procedure to upgrade to Mariadb with Zoneminder (or other databases) installed.

As with all my procedures I try to do them so a Linux novice can get Zoneminder running easily. But you have to follow all of the steps!

Bill
Last edited by bbunge on Thu Apr 21, 2016 7:43 pm, edited 1 time in total.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by asker »

Bill, did you face any issues with MySQL 5.7? Why did you choose to move to Mariadb?
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

asker wrote:Bill, did you face any issues with MySQL 5.7? Why did you choose to move to Mariadb?
I did have issues with MySQL 5.7 which were overcome by adding sql_mode = NO_ENGINE_SUBSTITUTION to my.cnf. Otherwise MySQL 5.7 works OK.

I chose to include the option to use Mariadb because I could and it provides another option. Centos 7 uses Mariadb. I feel it runs smoother than MySQL.

As of this I recommend switching to Mariadb before installing Zoneminder (new install) as the Zoneminder database will not be copied to the new directory. I will work out procedures to upgrade a running ZM system with Mariadb but it may take me time. There are other important things like a long bike ride before it rains this afternoon!

Stay tuned

Oh Mariadb upgrade procedures have been tested: https://wiki.zoneminder.com/Ubuntu_Serv ... erver_10.0.
hondaman
Posts: 25
Joined: Sat Jun 17, 2006 9:29 pm

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by hondaman »

I just want to thank you bbunge for writing that. I followed it yesterday to get zm installed. I'm glad I found it, I was trying to use some of the older guides and was getting tripped up by some differences.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

hondaman wrote:I just want to thank you bbunge for writing that. I followed it yesterday to get zm installed. I'm glad I found it, I was trying to use some of the older guides and was getting tripped up by some differences.
Glad it worked for you!

bb
hondaman
Posts: 25
Joined: Sat Jun 17, 2006 9:29 pm

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by hondaman »

bbunge wrote:
hondaman wrote:I just want to thank you bbunge for writing that. I followed it yesterday to get zm installed. I'm glad I found it, I was trying to use some of the older guides and was getting tripped up by some differences.
Glad it worked for you!

bb
There was one small error. And in full disclosure I didn't follow your advice about " I recommend you move the config file and replace the default my.cnf symbolic link. ", I simply edited my.cnf in place, as it was installed by Ubuntu.

In this portion of the guide:

Code: Select all

Underneath [mysql] add the following

sql_mode = NO_ENGINE_SUBSTITUTION
[mysql] didn't exit, so I had to add it after I loooked around the internet to make sure that was the correct thing to do.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

Actually, what you think is an error isn't. It is just another way of skinning the cat.
If you follow the symbolic links, two of them in the default LAMP install, you get back to /etc/mysql/mysql.cnf which is a pretty basic config file that relies on the MySQL 5.7 default settings. That, in a nutshell, is why I recommend replacing the first /etc/mysql/my.cnf symbolic link with a real configuration file. If you run Zoneminder long enough with lots of events, you will have to tune the MySQL, or Mariadb, settings.

bb
borism
Posts: 2
Joined: Mon Apr 25, 2016 1:11 am

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by borism »

Hi
Ubuntu 16.04 MySql Server 5.7.11-0ubuntu6 PHP7.0

The (sql_mode = NO_ENGINE_SUBSTITUTION) does not work - ERROR!!!!

Code: Select all

root@orion-15:~# mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql: [ERROR] unknown variable 'sql_mode=NO_ENGINE_SUBSTITUTION'
my.cnf (link - /etc/mysql/mysql.conf.d/mysqld.cnf)

Code: Select all

/etc/mysql/my.cnf                                     808/3241               24%
#
# The MySQL database server configuration file.
[mysqld_safe]
socket		= /var/run/mysqld/mysqld.sock
nice		= 0

[mysqld]
#
# * Basic Settings
#
user		= mysql
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
lc-messages-dir	= /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address		= 127.0.0.1
#
# * Fine Tuning
#
key_buffer_size		= 16M
max_allowed_packet	= 16M
thread_stack		= 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options  = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit	= 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries	= /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id		= 1
#log_bin			= /var/log/mysql/mysql-bin.log
expire_logs_days	= 10
max_binlog_size   = 100M
#binlog_do_db		= include_database_name
#binlog_ignore_db	= include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

# dop my minimum mem
skip-name-resolve
skip-federated

# dop kodirovka
skip-character-set-client-handshake
character-set-server = utf8
collation-server = utf8_unicode_ci
[mysql]
sql_mode = NO_ENGINE_SUBSTITUTION

what should I do
hondaman
Posts: 25
Joined: Sat Jun 17, 2006 9:29 pm

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by hondaman »

My /etc/mysql/my.cnf looks like this in its entirety http://pastebin.com/KWhpqwgx
I manually added these two lines:

Code: Select all

[mysqld]
sql_mode = NO_ENGINE_SUBSTITUTION
borism wrote:Hi
Ubuntu 16.04 MySql Server 5.7.11-0ubuntu6 PHP7.0

The (sql_mode = NO_ENGINE_SUBSTITUTION) does not work - ERROR!!!!

Code: Select all

root@orion-15:~# mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql: [ERROR] unknown variable 'sql_mode=NO_ENGINE_SUBSTITUTION'
my.cnf (link - /etc/mysql/mysql.conf.d/mysqld.cnf)

Code: Select all

/etc/mysql/my.cnf                                     808/3241               24%
#
# The MySQL database server configuration file.
[mysqld_safe]
socket		= /var/run/mysqld/mysqld.sock
nice		= 0

[mysqld]
#
# * Basic Settings
#
user		= mysql
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
lc-messages-dir	= /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address		= 127.0.0.1
#
# * Fine Tuning
#
key_buffer_size		= 16M
max_allowed_packet	= 16M
thread_stack		= 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options  = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit	= 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries	= /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id		= 1
#log_bin			= /var/log/mysql/mysql-bin.log
expire_logs_days	= 10
max_binlog_size   = 100M
#binlog_do_db		= include_database_name
#binlog_ignore_db	= include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

# dop my minimum mem
skip-name-resolve
skip-federated

# dop kodirovka
skip-character-set-client-handshake
character-set-server = utf8
collation-server = utf8_unicode_ci
[mysql]
sql_mode = NO_ENGINE_SUBSTITUTION

what should I do
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

When all else fails, read and follow the instructions!
hondaman
Posts: 25
Joined: Sat Jun 17, 2006 9:29 pm

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by hondaman »

I just took a closer look at the instructions you wrote (that I skipped), and I did in fact just now find an error. 8)

Code: Select all

cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf
That isn't a valid path. It should read:

Code: Select all

cp /etc/mysql/conf.d/mysql.cnf /etc/mysql/my.cnf
bbunge wrote:When all else fails, read and follow the instructions!
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by SteveGilvarry »

Interesting /etc/mysql/mysql.conf.d/mysqld.cnf is correct on my Mysql in 16.04. I believe the prefix was added to allow mariadb and mysql configuration to be kept separate. My /etc/mysql/conf.d/mysql.cnf is essentially empty.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
hondaman
Posts: 25
Joined: Sat Jun 17, 2006 9:29 pm

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by hondaman »

Oh gosh. I'm probably 0-2 now and should probably quit trying to break stuff that aint broke.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

hondaman wrote:Oh gosh. I'm probably 0-2 now and should probably quit trying to break stuff that aint broke.
That's OK. As I'm a hunt and peck typer I do make mistakes so it is good for someone to double check me! Spell check does not do well with code entries. :wink:
philip_d
Posts: 16
Joined: Mon Apr 25, 2016 1:17 pm

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by philip_d »

Hi, Everyone,

Is there anybody that can help me regarding 1.29 version.Below is the error when I connect on the browser. I changed already the timezone but still the same.I'm using Unbuntu LTS16.04 Server

ZoneMinder is not installed properly: php's date.timezone is not set to a valid timezone

Thanks
Locked