HOW TO INSTALL ZONEMINDER-master. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
User avatar
bkjaya1952
Posts: 97
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka
Contact:

HOW TO INSTALL ZONEMINDER-master. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by bkjaya1952 » Tue Feb 04, 2020 5:35 pm

I have successfully installed Zoneminder-mastaer with php 7.4 & mysql 8 on Ubuntu 19.10

Please see the following link to find the details on installation

https://wiki.zoneminder.com/Bkjaya%27s_Experiments
Last edited by bkjaya1952 on Thu Feb 06, 2020 8:59 am, edited 3 times in total.

bbunge
Posts: 2698
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: HOW TO INSTALL ZONEMINDER, v1.34.0. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by bbunge » Wed Feb 05, 2020 12:21 am

Once again this install procedure has steps that are not needed and will get you the development version of Zoneminder.

User avatar
bkjaya1952
Posts: 97
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka
Contact:

Re: HOW TO INSTALL ZONEMINDER, v1.34.0. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by bkjaya1952 » Wed Feb 05, 2020 8:24 am

bbunge wrote:
Wed Feb 05, 2020 12:21 am
Once again this install procedure has steps that are not needed and will get you the development version of Zoneminder.
According to my understanding , the testing of Zoneminder development version has not been banned .Otherwise . how can you improve the development versions ? The default php version to be used in next release of Ubuntu (Ubuntu 20.04 LTS) is php.7.4. And the latest Zoneminder is compatible with php7.4 . There shouldn't be any barriers to check the compatibility of Zoneminder with Ubuntu 20.04 LTS in advance . I will appreciate if you could point out the steps that are not needed , without making general statements.

User avatar
iconnor
Posts: 1325
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: HOW TO INSTALL ZONEMINDER, v1.34.0. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by iconnor » Wed Feb 05, 2020 1:45 pm

I don't think this is needed... if it is then I would like to fix that in zm...

sed -i "15i default_authentication_plugin= mysql_native_password" /etc/mysql/my.cnf

The long and short is that we don't want to be dependent on the old mysql password stuff...

add-apt-repository ppa:iconnor/zoneminder-master

should be changed to ppa:iconnor/zoneminder-1.34, otherwise you should change the title of this document to zoneminder master

There are a couple of other things that while not necessary can improve apache performance.

a2enmod headers
a2enmod expires

The following is not required and is not advised. It would allow the apache process to alter zoneminder, inject code, etc.
chown -R www-data:www-data /usr/share/zoneminder/

User avatar
asker
Posts: 1396
Joined: Sun Mar 01, 2015 12:12 pm

Re: HOW TO INSTALL ZONEMINDER, v1.34.0. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by asker » Wed Feb 05, 2020 2:08 pm

I was going to post but looks like Isaac beat me to it:

Some other thoughts for bkjaya1952:

- In general, good to see you are experimenting with new builds/OS releases. Always welcome. It looks like you did some good work in the past to get things working with Mysql8 and some of that work was inherited in the Ubuntu wiki instructions.

- It might be better for the ZM community if you chose to re-organize your posts as follows:
a) Create your own wiki index page - similar to what many users have done - just create a create called 'Bkjaya's experiments' or something like that like I did for my experiments here https://wiki.zoneminder.com/Various_ZM_thoughts
b) Upload instructions as you see fit as wiki articles, not PDF files
c) Try to post articles on the ZM wiki, not link to your wordpress blog because that blog has several advertisements that make the reading experience worse

There are a few of advantages to this:
1) It will be easier for you to manage as things change, rather than multiple PDF attachments that can get outdated soon. For example, Isaac posted specific comments above. You can easily make changes to your wiki article with those changes instead of uploading another PDF (and even if you did, people may discover the old PDF by random searches and get confused)

2) It will be easier for users to discover the right install instructions. User bbunge maintains a (semi)official ubuntu/debian install guide here https://wiki.zoneminder.com/Ubuntu which has been very helpful for users who in the past have done forum searches and come across different install instructions leading to frustration because when things change, these instructions are not updated or forgotten about. A lot of users come in for a short period of time and move on.

3) Title your instructions correctly so people know this is not for a stable release for example



Food for thought. You are of course, free do do what you think best.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

User avatar
bkjaya1952
Posts: 97
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka
Contact:

Re: HOW TO INSTALL ZONEMINDER, v1.34.0. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by bkjaya1952 » Thu Feb 06, 2020 8:04 am

iconnor wrote:
Wed Feb 05, 2020 1:45 pm
I don't think this is needed... if it is then I would like to fix that in zm...

sed -i "15i default_authentication_plugin= mysql_native_password" /etc/mysql/my.cnf

The long and short is that we don't want to be dependent on the old mysql password stuff...

add-apt-repository ppa:iconnor/zoneminder-master

should be changed to ppa:iconnor/zoneminder-1.34, otherwise you should change the title of this document to zoneminder master

There are a couple of other things that while not necessary can improve apache performance.

a2enmod headers
a2enmod expires

The following is not required and is not advised. It would allow the apache process to alter zoneminder, inject code, etc.
chown -R www-data:www-data /usr/share/zoneminder/
Thank you Isaac for your instructions !

User avatar
bkjaya1952
Posts: 97
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka
Contact:

Re: HOW TO INSTALL ZONEMINDER, v1.34.0. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by bkjaya1952 » Thu Feb 06, 2020 8:22 am

asker wrote:
Wed Feb 05, 2020 2:08 pm
I was going to post but looks like Isaac beat me to it:

Some other thoughts for bkjaya1952:

- In general, good to see you are experimenting with new builds/OS releases. Always welcome. It looks like you did some good work in the past to get things working with Mysql8 and some of that work was inherited in the Ubuntu wiki instructions.

- It might be better for the ZM community if you chose to re-organize your posts as follows:
a) Create your own wiki index page - similar to what many users have done - just create a create called 'Bkjaya's experiments' or something like that like I did for my experiments here https://wiki.zoneminder.com/Various_ZM_thoughts
b) Upload instructions as you see fit as wiki articles, not PDF files
c) Try to post articles on the ZM wiki, not link to your wordpress blog because that blog has several advertisements that make the reading experience worse

There are a few of advantages to this:
1) It will be easier for you to manage as things change, rather than multiple PDF attachments that can get outdated soon. For example, Isaac posted specific comments above. You can easily make changes to your wiki article with those changes instead of uploading another PDF (and even if you did, people may discover the old PDF by random searches and get confused)

2) It will be easier for users to discover the right install instructions. User bbunge maintains a (semi)official ubuntu/debian install guide here https://wiki.zoneminder.com/Ubuntu which has been very helpful for users who in the past have done forum searches and come across different install instructions leading to frustration because when things change, these instructions are not updated or forgotten about. A lot of users come in for a short period of time and move on.

3) Title your instructions correctly so people know this is not for a stable release for example



Food for thought. You are of course, free do do what you think best.
Hi asker
Thank you very much for your valuable guidance and instructions. I will definitely attend to the amendments as you pointed out .
Best regards

bbunge
Posts: 2698
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: HOW TO INSTALL ZONEMINDER, v1.34.0. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by bbunge » Thu Feb 06, 2020 1:58 pm

iconnor wrote:
Wed Feb 05, 2020 1:45 pm

There are a couple of other things that while not necessary can improve apache performance.

a2enmod headers
a2enmod expires

The following is not required and is not advised. It would allow the apache process to alter zoneminder, inject code, etc.
chown -R www-data:www-data /usr/share/zoneminder/
Made these changes to the WIKI install.

Will investigate MySQL 8 when time allows. Still recommend Mariadb-server...

bbunge
Posts: 2698
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: HOW TO INSTALL ZONEMINDER, v1.34.0. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by bbunge » Fri Feb 07, 2020 12:22 am

iconnor wrote:
Wed Feb 05, 2020 1:45 pm
I don't think this is needed... if it is then I would like to fix that in zm...

sed -i "15i default_authentication_plugin= mysql_native_password" /etc/mysql/my.cnf

The long and short is that we don't want to be dependent on the old mysql password stuff...
I did a test with Ubuntu 19.10 with MySQL 8 without any fancy password changes. And the Zoneminder 1.34.4 did create the zm database but finished with errors. Zoneminder would not start.

I had to go back and do:

Edit MySQL configuration to use native password

nano /etc/mysql/mysql.conf.d/mysqld.cnf

Below [mysqld] add

default_authentication_plugin = mysql_native_password

CTRL + o to save CTRL +x to exit

Restart MySQL

systemctl restart mysql

Note: The Zoneminder package will not complete successfully and will show errors. This will be corrected in the next step.

Create user and set permissions (press Enter after each entry)

mysql (Enter MySQL processing)

mysql> CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass';

mysql> GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;

mysql> FLUSH PRIVILEGES ;

mysql> \q

Reload MySQL

mysqladmin -uroot -p reload

Was able to start and run Zoneminder.
The above procedure is in the WIKI for Ubuntu and I have done those steps before or after installing Zoneminder. Both works.

I understand the need to have an install that does not mess with the database security. It may take someone more talented than me to come up with a way to set the install logic to detect the version of database installed and choose a custom zm database. For now...

User avatar
bkjaya1952
Posts: 97
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka
Contact:

Re: HOW TO INSTALL ZONEMINDER, v1.34.0. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by bkjaya1952 » Fri Feb 07, 2020 8:23 am

bbunge wrote:
Fri Feb 07, 2020 12:22 am
iconnor wrote:
Wed Feb 05, 2020 1:45 pm
I don't think this is needed... if it is then I would like to fix that in zm...

sed -i "15i default_authentication_plugin= mysql_native_password" /etc/mysql/my.cnf

The long and short is that we don't want to be dependent on the old mysql password stuff...
I did a test with Ubuntu 19.10 with MySQL 8 without any fancy password changes. And the Zoneminder 1.34.4 did create the zm database but finished with errors. Zoneminder would not start.

I had to go back and do:

Edit MySQL configuration to use native password

nano /etc/mysql/mysql.conf.d/mysqld.cnf

Below [mysqld] add

default_authentication_plugin = mysql_native_password

CTRL + o to save CTRL +x to exit

Restart MySQL

systemctl restart mysql

Note: The Zoneminder package will not complete successfully and will show errors. This will be corrected in the next step.

Create user and set permissions (press Enter after each entry)

mysql (Enter MySQL processing)

mysql> CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass';

mysql> GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;

mysql> FLUSH PRIVILEGES ;

mysql> \q

Reload MySQL

mysqladmin -uroot -p reload

Was able to start and run Zoneminder.
The above procedure is in the WIKI for Ubuntu and I have done those steps before or after installing Zoneminder. Both works.

I understand the need to have an install that does not mess with the database security. It may take someone more talented than me to come up with a way to set the install logic to detect the version of database installed and choose a custom zm database. For now...
At the moment PHP mysqli connector does not have support for caching_sha2_password. We will have to use mysql_native_password until the PHP 7.4 is revised to support caching_sha2_password.
https://mysqlserverteam.com/upgrading-t ... derations/

There is an answer( by Bill Karwin) to this problem in this link below. It is better to look in to Bill Karwin's findings to see whether ther is a way use caching_sha2_password

https://stackoverflow.com/questions/592 ... in-php-7-4

User avatar
bkjaya1952
Posts: 97
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka
Contact:

Re: HOW TO INSTALL ZONEMINDER-master. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by bkjaya1952 » Tue May 19, 2020 10:17 am

It is not necessary to use "mysql_native_password" in mysql8 when using the latest updated php 7.4.
Please refer https://bkjaya.wordpress.com/2020/05/10 ... cal-fossa/

bbunge
Posts: 2698
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: HOW TO INSTALL ZONEMINDER-master. ON UBUNTU 19.10 (eoan), with php 7.4 & mysql 8

Post by bbunge » Tue May 19, 2020 11:18 pm

bkjaya1952 wrote:
Tue May 19, 2020 10:17 am
It is not necessary to use "mysql_native_password" in mysql8 when using the latest updated php 7.4.
Please refer https://bkjaya.wordpress.com/2020/05/10 ... cal-fossa/
Confirmed that the "mysql_native_password" in MySQL 8 with PHP 7.4 is no longer needed.
However, the instructions at https://bkjaya.wordpress.com/2020/05/10 ... cal-fossa/ contain steps that are not needed.
Configure and secure the MySQL database before installing Zoneminder.
Secure the MySQL database with the command: mysql_secure_installation
The Zoneminder database is created and sets permissions from the .deb install file
a2enmod cgi and a2enmod rewrite are performed by the Zoneminder .deb installer
chown -R www-data:www-data /usr/share/zoneminder is a security risk! Don't do it!!!

Up to date install for Zoneminder is at: https://wiki.zoneminder.com/Ubuntu_Serv ... der_1.34.x

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests