<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.staging.zoneminder.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Simpler</id>
	<title>ZoneMinder Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.staging.zoneminder.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Simpler"/>
	<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/Special:Contributions/Simpler"/>
	<updated>2026-04-20T08:10:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Common_Issues_with_Zoneminder_Installation_on_Ubuntu&amp;diff=14169</id>
		<title>Common Issues with Zoneminder Installation on Ubuntu</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Common_Issues_with_Zoneminder_Installation_on_Ubuntu&amp;diff=14169"/>
		<updated>2016-11-20T01:41:16Z</updated>

		<summary type="html">&lt;p&gt;Simpler: Changed &amp;quot;apt-get dist-upgrade&amp;quot; to &amp;quot;apt-get install zoneminder&amp;quot; for &amp;quot;Ubuntu 14.04 - ZM 1.26.5 or later to 1.30.0 or the latest PPA version&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;08AUG16&lt;br /&gt;
&lt;br /&gt;
With some changes “in-the-works” for Ubuntu installs by the hard working volunteers who keep Zoneminder up-to-date, it was recommended that we post fixes/instructions for some issues that continue to surface. This document will likely grow over time but may become obsolete as procedures become better documented.&lt;br /&gt;
&lt;br /&gt;
The upgrade procedures to 1.30.0 have not been fully tested for Ubuntu 15x but have been written with the knowledge of the behavior of the 1.30.0 install package. Post concerns or failures on the forum.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Zoneminder &amp;quot;Master&amp;quot; PPA&amp;#039;&amp;#039;&amp;#039; This is to remind you that software installed from the iconnor zoneminder-master PPA is BETA software and NOT recommended for production systems! BETA software may have some features that do not work correctly! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Zoneminder Database==&lt;br /&gt;
See Database Tips and Tricks for more topics: http://www.zoneminder.com/wiki/index.php/General_Notes#Database_Tricks.2FTips&lt;br /&gt;
&lt;br /&gt;
===Enable and convert MySQL to innodb_file_per_table for Zoneminder===&lt;br /&gt;
 &lt;br /&gt;
Note: You may wish to convert MyISAM tables to InnoDB tables before you proceed. Upgrading Zoneminder to 1.26 or newer should do this for you.&lt;br /&gt;
&lt;br /&gt;
innodb_file_per_table is by default ON Mysql 5.6.6 and onwards. There is plenty of stuff on Google about pros &amp;amp; cons of innodb_file_per_table.&lt;br /&gt;
This post details how to enable innodb_file_per_table on an existing database. Because innodb_file_per_table affects new tables only, created after innodb_file_per_table is enabled, we need to recreate old databases to force innodb_file_per_table on old tables and reclaim some disk space.&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Backup First&lt;br /&gt;
Create a dir to take backups:&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
Note: I found it helpful to create a file which contained the MySQL user and password. Otherwise you will have to enter the user and password for every operation.&lt;br /&gt;
&lt;br /&gt;
 nano .my.cnf&lt;br /&gt;
&lt;br /&gt;
Enter this content&lt;br /&gt;
&lt;br /&gt;
 [client]&lt;br /&gt;
 user=root&lt;br /&gt;
 password=mysqlpass&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make backup directory&lt;br /&gt;
 mkdir backup&lt;br /&gt;
&lt;br /&gt;
 cd backup&lt;br /&gt;
&lt;br /&gt;
Copy MySQL data files (raw)&lt;br /&gt;
(If all goes well, we will not need this)&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
If you have other services that use MySQL you will want to stop them and possibly Apache.&lt;br /&gt;
&lt;br /&gt;
 service mysql stop &amp;amp;&amp;amp; cp -ra /var/lib/mysql mysqldata &amp;amp;&amp;amp; service mysql start&lt;br /&gt;
&lt;br /&gt;
Take mysqldump&lt;br /&gt;
As soon as above line completes, take a mysqldump of all databases&lt;br /&gt;
&lt;br /&gt;
 mysqldump --routines --events --flush-privileges --all-databases &amp;gt; all-db.sql&lt;br /&gt;
&lt;br /&gt;
Drop Databases&lt;br /&gt;
Create a sql file to drop all databases EXCEPT mysql database&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;SELECT DISTINCT CONCAT (&amp;#039;DROP DATABASE &amp;#039;,TABLE_SCHEMA,&amp;#039; ;&amp;#039;) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA &amp;lt;&amp;gt; &amp;#039;mysql&amp;#039; AND TABLE_SCHEMA &amp;lt;&amp;gt; &amp;#039;information_schema&amp;#039;;&amp;quot; | tail -n+2 &amp;gt; drop.sql&lt;br /&gt;
&lt;br /&gt;
Verify if drop.sql has correct database names and then execute drop.sql queries.&lt;br /&gt;
&lt;br /&gt;
 mysql &amp;lt; drop.sql&lt;br /&gt;
&lt;br /&gt;
Verify all InnoDB tables gone&lt;br /&gt;
&lt;br /&gt;
 SELECT table_name, table_schema, engine FROM information_schema.tables WHERE engine = &amp;#039;InnoDB&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
Remove InnoDB files&lt;br /&gt;
Stop mysql server first&lt;br /&gt;
&lt;br /&gt;
 service mysql stop&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&lt;br /&gt;
 rm /var/lib/mysql/ibdata1 &amp;amp;&amp;amp; rm /var/lib/mysql/ib_logfile0 &amp;amp;&amp;amp; rm /var/lib/mysql/ib_logfile1&lt;br /&gt;
&lt;br /&gt;
At this point most likely you will have only /var/lib/mysql/mysql directory only.&lt;br /&gt;
&lt;br /&gt;
Enable innodb_file_per_table&lt;br /&gt;
&lt;br /&gt;
Open my.cnf file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Add following line after [mysqld]&lt;br /&gt;
&lt;br /&gt;
 innodb_file_per_table&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Time to import from mysqldump&lt;br /&gt;
Start mysql server now&lt;br /&gt;
&lt;br /&gt;
 service mysql start&lt;br /&gt;
&lt;br /&gt;
Run mysql import&lt;br /&gt;
&lt;br /&gt;
 mysql &amp;lt; all-db.sql&lt;br /&gt;
&lt;br /&gt;
Force mysql_upgrade (to generate performance_schema)&lt;br /&gt;
 &lt;br /&gt;
 mysql_upgrade --force&lt;br /&gt;
&lt;br /&gt;
That’s All!&lt;br /&gt;
&lt;br /&gt;
Restart Zoneminder (and any other services you have stopped)&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Check for proper operation and that all your events are present. &lt;br /&gt;
&lt;br /&gt;
When you are satisfied that all is worling well remove the backup directory and password filr=e&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
 rm -r backup&lt;br /&gt;
&lt;br /&gt;
 rm .my.cnf&lt;br /&gt;
&lt;br /&gt;
You are finished!&lt;br /&gt;
&lt;br /&gt;
This procedure has been adopted from https://rtcamp.com/tutorials/mysql/enable-innodb-file-per-table. Thanks to Rahul Bansal!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Adding Permissions to allow Database Upgrade===&lt;br /&gt;
Versions of Zoneminder up to and including 1.28.1 in Ubuntu would automatically add the zm database to MySQL. Beginning about August &lt;br /&gt;
2015 the development version from the iconnor-master PPA omitted this step becoming like the Debian install process. Manually adding the &lt;br /&gt;
database to MySQL will be necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install the zm database (after doing apt-get install zoneminder)&lt;br /&gt;
&lt;br /&gt;
Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
command line which is not secure!&lt;br /&gt;
&lt;br /&gt;
Go to the root directory&lt;br /&gt;
 &lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
Create a hidden password file&lt;br /&gt;
&lt;br /&gt;
 nano .my.cnf&lt;br /&gt;
&lt;br /&gt;
Enter this content (but use your MySQL root password!)&lt;br /&gt;
&lt;br /&gt;
 [client]&lt;br /&gt;
 user=root&lt;br /&gt;
 password=(mysqlpass)&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Create database permissions&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;grant select,insert,update,delete,create,alter,lock tables on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove password file&lt;br /&gt;
&lt;br /&gt;
 rm .my.cnf&lt;br /&gt;
&lt;br /&gt;
Continue with the Zoneminder installation&lt;br /&gt;
&lt;br /&gt;
==Upgrades==&lt;br /&gt;
===Ubuntu 14.04 with MySQL 5.6 and Zoneminder from PPA===&lt;br /&gt;
&lt;br /&gt;
This procedure starts with Ubuntu Server 14.04-3 with LAMP added. Zoneminder is not installed. It is possible to upgrade a system running Zoneminder but it is not covered in this procedure.&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Stop MySQL&lt;br /&gt;
&lt;br /&gt;
 service mysql stop&lt;br /&gt;
&lt;br /&gt;
Remove MySQL&lt;br /&gt;
&lt;br /&gt;
 apt-get purge mysql&lt;br /&gt;
&lt;br /&gt;
Install MySQL 5.6 (will upgrade the MySQL client)&lt;br /&gt;
&lt;br /&gt;
 apt-get install mysql-server-5.6&lt;br /&gt;
&lt;br /&gt;
Note: You may need to edit my.cnf and change the value: sql_mode= to sql_mode=NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
Follow the install instructions: https://wiki.zoneminder.com/Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.29.0_the_easy_way&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 14.04 - ZM 1.26.5 or later to 1.30.0 or the latest PPA version===&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Add Repository &lt;br /&gt;
&lt;br /&gt;
Note: if you need to remove a repository use: add-apt-repository --remove ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Upgrade the installation&lt;br /&gt;
&lt;br /&gt;
 apt-get upgrade  (may return nothing to upgrade)&lt;br /&gt;
&lt;br /&gt;
 apt-get install zoneminder  (&amp;quot;apt-get dist-upgrade&amp;quot; is a dangerous command for a stable system.)&lt;br /&gt;
&lt;br /&gt;
You will be asked if you want to replace /etc/init.d/zoneminder. Choose &amp;quot;Y&amp;quot;&lt;br /&gt;
&lt;br /&gt;
With ZM 1.30.3 the database will automatically upgrade.&lt;br /&gt;
&lt;br /&gt;
Add back the delay to allow MySQL to start before Zoneminder&lt;br /&gt;
&lt;br /&gt;
 nano /etc/init.d/zoneminder&lt;br /&gt;
&lt;br /&gt;
Add sleep 15 as shown:&lt;br /&gt;
&lt;br /&gt;
 start() {&lt;br /&gt;
      sleep 15&lt;br /&gt;
      echo -n &amp;quot;Starting $prog: &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Remove symbolic link&lt;br /&gt;
&lt;br /&gt;
 rm /etc/apache2/conf-enabled/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Set permissions of /etc/zm/zm.conf to root:www-data 740&lt;br /&gt;
&lt;br /&gt;
 chmod 740 /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
 chown root:www-data /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Enable Zoneminder and rewrite &lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder (Note: Zoneminder may have started automatically after the dist-upgrade)&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php5/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit  &lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 restart&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder. Click on Options - Paths &lt;br /&gt;
&lt;br /&gt;
Change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 15.04 - ZM 1.26.5 or later to 1.30.0 or the latest PPA version===&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Add Repository&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl stop zoneminder.service&lt;br /&gt;
&lt;br /&gt;
There are some database changes which should update automatically. To preclude problems, run:&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Upgrade the installation&lt;br /&gt;
&lt;br /&gt;
 apt-get upgrade  (may return nothing to upgrade)&lt;br /&gt;
&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
Note: the 1.30.0 from the PPA does a database upgrade automatically. &lt;br /&gt;
&lt;br /&gt;
Configure Apache&lt;br /&gt;
&lt;br /&gt;
 rm /etc/apache2/conf-enabled/zoneminder.conf &lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php5/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit  &lt;br /&gt;
&lt;br /&gt;
Restart Services&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
 systemctl start zoneminder.service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Open Zoneminder. Click on Options - Paths &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Italic text&amp;#039;&amp;#039;&lt;br /&gt;
Change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
If Zoneminder does not start when you boot your server, run these commands:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop zoneminder.service&lt;br /&gt;
&lt;br /&gt;
 systemctl disable zoneminder.service&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder.service&lt;br /&gt;
&lt;br /&gt;
 systemctl start zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Reboot your server and check that Zoneminder started.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 15.10 - ZM 1.28.1 to 1.30.0 the the latest PPA version===&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Add Repository (This adds the PPA master which is for testing only!)&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
Update package list&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl stop zoneminder.service&lt;br /&gt;
&lt;br /&gt;
There are some database changes which should update automatically. To preclude problems, run:&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Upgrade the installation&lt;br /&gt;
&lt;br /&gt;
 apt-get upgrade &lt;br /&gt;
&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
Configure Apache&lt;br /&gt;
&lt;br /&gt;
 rm /etc/apache2/conf-enabled/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 &lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php5/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart Services&lt;br /&gt;
&lt;br /&gt;
 systemctl start zoneminder&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder in a browser. Click on Options - Paths &lt;br /&gt;
&lt;br /&gt;
Check that PATH_ZMS is set to: /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 16.04 - ZM 1.30.0 Upgrade===&lt;br /&gt;
Ubuntu 16.04 contains Zoneminder 1.29.0. The official release date is 21APR16. &lt;br /&gt;
&lt;br /&gt;
To upgrade to Zoneminder 1.30.0&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Add Repository (This adds the PPA master which is for testing only!)&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
Update package list&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl stop zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Note: It may be a good idea to backup your database. This procedure was tested with MySQL 5.7 but should work with Mariadb 10.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrade the installation (Zoneminder will upgrade with the &amp;quot;apt-get dist-upgrade&amp;quot; command. Your database will automatically be upgraded.&lt;br /&gt;
&lt;br /&gt;
 apt-get upgrade &lt;br /&gt;
&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl start zoneminder.service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Ubuntu 15.10 with ZM 1.29.0 from the PPA to Ubuntu 16.04====&lt;br /&gt;
&lt;br /&gt;
 do-release-upgrade -d&lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Fix to allow API to work&lt;br /&gt;
&lt;br /&gt;
 nano /etc/apache2/apache2.conf&lt;br /&gt;
&lt;br /&gt;
Change &amp;quot;AllowOverride None&amp;quot; to &amp;quot;AllowOverride All&amp;quot; two places as shown below&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /usr/share&amp;gt;&lt;br /&gt;
         AllowOverride All&lt;br /&gt;
         Require all granted&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /var/www/&amp;gt;&lt;br /&gt;
         Options Indexes FollowSymLinks&lt;br /&gt;
         AllowOverride All&lt;br /&gt;
         Require all granted&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
If you want to switch to MariaDB server see: https://wiki.zoneminder.com/Install_MariaDB_Server_10.0&lt;br /&gt;
&lt;br /&gt;
====Ubuntu 14.04 with ZM 1.29.0 from the PPA to Ubuntu 16.04====&lt;br /&gt;
&lt;br /&gt;
02MAY16  This upgrade procedure has been tested successfully! It may not be necessary to take a dump of your zm database but I did it just-in-case MySQL messed something up. &lt;br /&gt;
&lt;br /&gt;
Make sure your install is up to date!&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get upgrade&lt;br /&gt;
 sudo apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
Reboot if needed&lt;br /&gt;
&lt;br /&gt;
Login to a console and stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 sudo service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Take a dump of the Zoneminder (zm) database (the zm.sql will be saved in your &amp;quot;home&amp;quot; directory)&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p zm &amp;gt; zm.sql &lt;br /&gt;
&lt;br /&gt;
Drop the &amp;quot;zm&amp;quot; database&lt;br /&gt;
&lt;br /&gt;
 mysqladmin -uroot -p drop zm&lt;br /&gt;
&lt;br /&gt;
Run the Ubuntu upgrade (note: the &amp;quot;-d&amp;quot; is required until Ubuntu 16.04-1 is released)&lt;br /&gt;
&lt;br /&gt;
 sudo do-release-upgrade -d&lt;br /&gt;
&lt;br /&gt;
When prompted, overwrite the zoneminder configuration with the package maintainers version. &lt;br /&gt;
&lt;br /&gt;
My upgrade informed me MySQL server upgrade failed. I had to continue and reboot (Ctrl+Alt+Del) the server manually.&lt;br /&gt;
&lt;br /&gt;
Log in and become root&lt;br /&gt;
&lt;br /&gt;
 sudo su &lt;br /&gt;
&lt;br /&gt;
Clean up packages that were not removed when the upgrade failed (may not be needed in the future)&lt;br /&gt;
&lt;br /&gt;
 apt-get autoremove&lt;br /&gt;
&lt;br /&gt;
Install PHP7&lt;br /&gt;
&lt;br /&gt;
 apt-get install php php-gd libapache2-mod-php php7.0-mysql&lt;br /&gt;
&lt;br /&gt;
Secure MySQL&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Create Zoneminder (zm) database in MySQL&lt;br /&gt;
&lt;br /&gt;
 mysqladmin -uroot -p create zm&lt;br /&gt;
&lt;br /&gt;
Import the zm database&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p zm &amp;lt; zm.sql&lt;br /&gt;
&lt;br /&gt;
Set permissions&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  (this removes the current symbolic link)&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
To change MySQL settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
In the [mysqld] section add the following&lt;br /&gt;
&lt;br /&gt;
 sql_mode = NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Set the Timezone on PHP7 &lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.0/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Fix to allow API to work&lt;br /&gt;
&lt;br /&gt;
 nano /etc/apache2/apache2.conf&lt;br /&gt;
&lt;br /&gt;
Change &amp;quot;AllowOverride None&amp;quot; to &amp;quot;AllowOverride All&amp;quot; two places as shown below&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /usr/share&amp;gt;&lt;br /&gt;
         AllowOverride All&lt;br /&gt;
         Require all granted&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /var/www/&amp;gt;&lt;br /&gt;
         Options Indexes FollowSymLinks&lt;br /&gt;
         AllowOverride All&lt;br /&gt;
         Require all granted&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable and start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
You should be able to connect to Zoneminder in your web browser!&lt;br /&gt;
&lt;br /&gt;
====Ubuntu with ZM 1.28.1 or Earlier Upgrade to Ubuntu 16.04====&lt;br /&gt;
&lt;br /&gt;
Upgrade Ubuntu running Zoneminder 1.28.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
05MAY16 This has been run on Ubuntu 14.04 with Zoneminder 1.26.5 and Ubuntu 15.10 with Zoneminder 1.28.1. You have two database options: (1)MySQL 5.7 or (2)Mariadb 10.1. Switching to Mariadb Server is a good thing as it seems to work smoother than MySQL 5.7.&lt;br /&gt;
&lt;br /&gt;
Make sure your install is up to date!&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get upgrade&lt;br /&gt;
 sudo apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
Reboot if needed&lt;br /&gt;
&lt;br /&gt;
Login to a console and stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 sudo service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Take a dump of the Zoneminder (zm) database (the zm.sql will be saved in your &amp;quot;home&amp;quot; directory)You will need this if you choose Mariadb or if something goes wrong with the upgrade.&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p zm &amp;gt; zm.sql &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the Ubuntu upgrade (note: the &amp;quot;-d&amp;quot; is required until Ubuntu 16.04-1 is released)&lt;br /&gt;
&lt;br /&gt;
 sudo do-release-upgrade -d&lt;br /&gt;
&lt;br /&gt;
When prompted, overwrite the zoneminder configuration with the package maintainers version. &lt;br /&gt;
&lt;br /&gt;
If, for some reason, you get an error message that MySQL did not upgrade, continue to reboot, manually if needed, and run on restart&lt;br /&gt;
&lt;br /&gt;
 apt-get autoremove&lt;br /&gt;
&lt;br /&gt;
Log in and become root&lt;br /&gt;
&lt;br /&gt;
 sudo su &lt;br /&gt;
&lt;br /&gt;
Install PHP7&lt;br /&gt;
&lt;br /&gt;
 apt-get install php php-gd libapache2-mod-php php7.0-mysql&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Use the default MySQL 5.7&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To allow the database upgrade to work you will need to edit one sql file&lt;br /&gt;
&lt;br /&gt;
 nano /usr/share/zoneminder/db/zm_update-1.28.99.sql&lt;br /&gt;
&lt;br /&gt;
Search for [ALTER IGNORE TABLE] (Ctrl + w then type ALTER IGNORE TABLE and press Enter. Remove IGNORE then &lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  (this removes the current symbolic link)&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
To change MySQL settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
In the [mysqld] section add the following&lt;br /&gt;
&lt;br /&gt;
 sql_mode = NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Recommended: Secure MySQL.&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Scroll down to Continue Installation and skip Mariadb &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Replace MySQL 5.7 with Mariadb 10&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
&lt;br /&gt;
Secure Mariadb (set root password in Mariadb and etc.)&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Create Zoneminder (zm) database in MySQL&lt;br /&gt;
&lt;br /&gt;
 mysqladmin -uroot -p create zm&lt;br /&gt;
&lt;br /&gt;
Import the zm database&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p zm &amp;lt; zm.sql&lt;br /&gt;
&lt;br /&gt;
Set permissions&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Run the database upgrade&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/zmupdate.pl  &lt;br /&gt;
&lt;br /&gt;
To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  (this removes the current symbolic link)&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
When you want to change MySQL settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Continue Installation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Set permissions&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Run the database upgrade&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/zmupdate.pl  &lt;br /&gt;
&lt;br /&gt;
Set the Timezone on PHP7 &lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.0/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Fix to allow API to work&lt;br /&gt;
&lt;br /&gt;
 nano /etc/apache2/apache2.conf&lt;br /&gt;
&lt;br /&gt;
Change &amp;quot;AllowOverride None&amp;quot; to &amp;quot;AllowOverride All&amp;quot; two places as shown below&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /usr/share&amp;gt;&lt;br /&gt;
         AllowOverride All&lt;br /&gt;
         Require all granted&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /var/www/&amp;gt;&lt;br /&gt;
         Options Indexes FollowSymLinks&lt;br /&gt;
         AllowOverride All&lt;br /&gt;
         Require all granted&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable and start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
Connect to Zoneminder in your web browser, open Options and set PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
==Ubuntu Swap File==&lt;br /&gt;
I have been puzzled for some time as to why Ubuntu will write to the swap file when there is plenty of RAM installed. I&amp;#039;ve discovered that writing to the swap file is controlled by the &amp;quot;swappiness&amp;quot; setting! By default, Ubuntu uses a swappiness value of 60 which means that when 40% of memory is used, the system will start swapping data from memory to the swap file. &lt;br /&gt;
Here is some info you can use to check and/or change swappiness:&lt;br /&gt;
&lt;br /&gt;
To check the swappiness value&lt;br /&gt;
&lt;br /&gt;
 cat /proc/sys/vm/swappiness&lt;br /&gt;
&lt;br /&gt;
To change the swappiness value A temporary change (lost on reboot) with a swappiness value of 10 can be made with&lt;br /&gt;
&lt;br /&gt;
 sudo sysctl vm.swappiness=10&lt;br /&gt;
&lt;br /&gt;
To make a change permanent, edit the configuration file with your favorite editor:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:&lt;br /&gt;
&lt;br /&gt;
 vm.swappiness=10&lt;br /&gt;
&lt;br /&gt;
The more RAM your system has the lower the swappiness value can be. Possibly even &amp;quot;0&amp;quot;  My production system with 16 GIG of RAM works well with a value of &amp;quot;10&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Save the file and reboot.&lt;/div&gt;</summary>
		<author><name>Simpler</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Common_Issues_with_Zoneminder_Installation_on_Ubuntu&amp;diff=7161</id>
		<title>Common Issues with Zoneminder Installation on Ubuntu</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Common_Issues_with_Zoneminder_Installation_on_Ubuntu&amp;diff=7161"/>
		<updated>2015-11-15T00:46:55Z</updated>

		<summary type="html">&lt;p&gt;Simpler: removed unnecessary (and incorrect) double quote.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;21OCT15&lt;br /&gt;
&lt;br /&gt;
With some changes “in-the-works” for Ubuntu installs by the hard working volunteers who keep Zoneminder up-to-date, it was recommended that we post fixes/instructions for some issues that continue to surface. One difference will be that the Zoneminder install will no longer automatically install the zm database in MySQL. This document will likely grow over time but may become obsolete as procedures become better documented.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Zoneminder &amp;quot;Master&amp;quot; PPA&amp;#039;&amp;#039;&amp;#039; This is to remind you that software installed from the iconnor zoneminder-master PPA is BETA software and NOT recommended for production systems! BETA software may have some features that do not work correctly! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Zoneminder Database==&lt;br /&gt;
See Database Tips and Tricks for more topics: http://www.zoneminder.com/wiki/index.php/General_Notes#Database_Tricks.2FTips&lt;br /&gt;
&lt;br /&gt;
===Enable and convert MySQL to innodb_file_per_table for Zoneminder===&lt;br /&gt;
 &lt;br /&gt;
Note: You may wish to convert MyISAM tables to InnoDB tables before you proceed. Upgrading Zoneminder to 1.26 or newer should do this for you.&lt;br /&gt;
&lt;br /&gt;
innodb_file_per_table is by default ON Mysql 5.6.6 and onwards. There is plenty of stuff on Google about pros &amp;amp; cons of innodb_file_per_table.&lt;br /&gt;
This post details how to enable innodb_file_per_table on an existing database. Because innodb_file_per_table affects new tables only, created after innodb_file_per_table is enabled, we need to recreate old databases to force innodb_file_per_table on old tables and reclaim some disk space.&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Backup First&lt;br /&gt;
Create a dir to take backups:&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
Note: I found it helpful to create a file which contained the MySQL user and password. Otherwise you will have to enter the user and password for every operation.&lt;br /&gt;
&lt;br /&gt;
 nano .my.cnf&lt;br /&gt;
&lt;br /&gt;
Enter this content&lt;br /&gt;
&lt;br /&gt;
 [client]&lt;br /&gt;
 user=root&lt;br /&gt;
 password=mysqlpass&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make backup directory&lt;br /&gt;
 mkdir backup&lt;br /&gt;
&lt;br /&gt;
 cd backup&lt;br /&gt;
&lt;br /&gt;
Copy MySQL data files (raw)&lt;br /&gt;
(If all goes well, we will not need this)&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
If you have other services that use MySQL you will want to stop them and possibly Apache.&lt;br /&gt;
&lt;br /&gt;
 service mysql stop &amp;amp;&amp;amp; cp -ra /var/lib/mysql mysqldata &amp;amp;&amp;amp; service mysql start&lt;br /&gt;
&lt;br /&gt;
Take mysqldump&lt;br /&gt;
As soon as above line completes, take a mysqldump of all databases&lt;br /&gt;
&lt;br /&gt;
 mysqldump --routines --events --flush-privileges --all-databases &amp;gt; all-db.sql&lt;br /&gt;
&lt;br /&gt;
Drop Databases&lt;br /&gt;
Create a sql file to drop all databases EXCEPT mysql database&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;SELECT DISTINCT CONCAT (&amp;#039;DROP DATABASE &amp;#039;,TABLE_SCHEMA,&amp;#039; ;&amp;#039;) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA &amp;lt;&amp;gt; &amp;#039;mysql&amp;#039; AND TABLE_SCHEMA &amp;lt;&amp;gt; &amp;#039;information_schema&amp;#039;;&amp;quot; | tail -n+2 &amp;gt; drop.sql&lt;br /&gt;
&lt;br /&gt;
Verify if drop.sql has correct database names and then execute drop.sql queries.&lt;br /&gt;
&lt;br /&gt;
 mysql &amp;lt; drop.sql&lt;br /&gt;
&lt;br /&gt;
Verify all InnoDB tables gone&lt;br /&gt;
&lt;br /&gt;
 SELECT table_name, table_schema, engine FROM information_schema.tables WHERE engine = &amp;#039;InnoDB&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
Remove InnoDB files&lt;br /&gt;
Stop mysql server first&lt;br /&gt;
&lt;br /&gt;
 service mysql stop&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&lt;br /&gt;
 rm /var/lib/mysql/ibdata1 &amp;amp;&amp;amp; rm /var/lib/mysql/ib_logfile0 &amp;amp;&amp;amp; rm /var/lib/mysql/ib_logfile1&lt;br /&gt;
&lt;br /&gt;
At this point most likely you will have only /var/lib/mysql/mysql directory only.&lt;br /&gt;
&lt;br /&gt;
Enable innodb_file_per_table&lt;br /&gt;
&lt;br /&gt;
Open my.cnf file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Add following line after [mysqld]&lt;br /&gt;
&lt;br /&gt;
 innodb_file_per_table&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Time to import from mysqldump&lt;br /&gt;
Start mysql server now&lt;br /&gt;
&lt;br /&gt;
 service mysql start&lt;br /&gt;
&lt;br /&gt;
Run mysql import&lt;br /&gt;
&lt;br /&gt;
 mysql &amp;lt; all-db.sql&lt;br /&gt;
&lt;br /&gt;
Force mysql_upgrade (to generate performance_schema)&lt;br /&gt;
 &lt;br /&gt;
 mysql_upgrade --force&lt;br /&gt;
&lt;br /&gt;
That’s All!&lt;br /&gt;
&lt;br /&gt;
Restart Zoneminder (and any other services you have stopped)&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Check for proper operation and that all your events are present. &lt;br /&gt;
&lt;br /&gt;
When you are satisfied that all is worling well remove the backup directory and password filr=e&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
 rm -r backup&lt;br /&gt;
&lt;br /&gt;
 rm .my.cnf&lt;br /&gt;
&lt;br /&gt;
You are finished!&lt;br /&gt;
&lt;br /&gt;
This procedure has been adopted from https://rtcamp.com/tutorials/mysql/enable-innodb-file-per-table. Thanks to Rahul Bansal!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Adding Permissions to allow Database Upgrade===&lt;br /&gt;
Versions of Zoneminder up to and including 1.28.1 in Ubuntu would automatically add the zm database to MySQL. Beginning about August &lt;br /&gt;
2015 the development version from the iconnor-master PPA omitted this step becoming like the Debian install process. Manually adding the &lt;br /&gt;
database to MySQL will be &lt;br /&gt;
To install the zm database (after doing apt-get install zoneminder)&lt;br /&gt;
Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
command line which is not secure!&lt;br /&gt;
&lt;br /&gt;
Go to the root directory&lt;br /&gt;
 &lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
Create a hidden password file&lt;br /&gt;
&lt;br /&gt;
 nano .my.cnf&lt;br /&gt;
&lt;br /&gt;
Enter this content (but use your MySQL root password!)&lt;br /&gt;
&lt;br /&gt;
 [client]&lt;br /&gt;
 user=root&lt;br /&gt;
 password=(mysqlpass)&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Create database (press ENTER after each command)&lt;br /&gt;
&lt;br /&gt;
 mysql &amp;lt; /usr/share/zoneminder/db/zm_create.sql &lt;br /&gt;
&lt;br /&gt;
 mysql &lt;br /&gt;
&lt;br /&gt;
 grant create,select,insert,update,delete on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
 \q (enter) (to quit)&lt;br /&gt;
&lt;br /&gt;
Note for upgrade from prior version of Zoneminder:&lt;br /&gt;
The latest version from the PPA Master contains a new table. If you try to run zmupdate.pl to upgrade the database you will ge an error. You need to run the entry: &lt;br /&gt;
&lt;br /&gt;
 grant select,insert,update,delete,create on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
Remove password file&lt;br /&gt;
&lt;br /&gt;
 rm .my.cnf&lt;br /&gt;
&lt;br /&gt;
Continue with the Zoneminder installation&lt;br /&gt;
&lt;br /&gt;
==Upgrades==&lt;br /&gt;
===Ubuntu 14.04 with MySQL 5.6 and Zoneminder from PPA===&lt;br /&gt;
&lt;br /&gt;
Note: 10NOV15 This procedure will not work as the version of Zoneminder in the PPA was removed. It will work for the version in the development PPA (zoneminder-master)&lt;br /&gt;
&lt;br /&gt;
This procedure starts with Ubuntu Server 14.04-3 with LAMP added. Zoneminder is not installed. It is possible to upgrade a system running Zoneminder but it is not covered in this procedure.&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Stop MySQL&lt;br /&gt;
&lt;br /&gt;
 service mysql stop&lt;br /&gt;
&lt;br /&gt;
Remove MySQL&lt;br /&gt;
&lt;br /&gt;
 apt-get purge mysql&lt;br /&gt;
&lt;br /&gt;
Install MySQL 5.6 (will upgrade the MySQL client)&lt;br /&gt;
&lt;br /&gt;
 apt-get install mysql-server-5.6&lt;br /&gt;
&lt;br /&gt;
Add Repository&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get install zoneminder&lt;br /&gt;
&lt;br /&gt;
Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
command line which is not secure!&lt;br /&gt;
&lt;br /&gt;
Go to the root dir&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
Create a hidden password file&lt;br /&gt;
&lt;br /&gt;
 nano .my.cnf&lt;br /&gt;
&lt;br /&gt;
Enter this content&lt;br /&gt;
&lt;br /&gt;
 [client]&lt;br /&gt;
 user=root&lt;br /&gt;
 password=(mysqlpass)&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Create database&lt;br /&gt;
&lt;br /&gt;
 mysql &amp;lt; /usr/share/zoneminder/db/zm_create.sql &lt;br /&gt;
&lt;br /&gt;
 mysql &lt;br /&gt;
&lt;br /&gt;
 grant select,insert,update,delete on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
 \q (enter) (to quit)&lt;br /&gt;
&lt;br /&gt;
Remove password file&lt;br /&gt;
&lt;br /&gt;
 rm .my.cnf&lt;br /&gt;
&lt;br /&gt;
Set permissions of /etc/zm/zm.conf to root:www-data 740&lt;br /&gt;
&lt;br /&gt;
 chmod 740 /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
 chown root:www-data /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Add delay to allow MySQL to start before Zoneminder&lt;br /&gt;
&lt;br /&gt;
 nano /etc/init.d/zoneminder&lt;br /&gt;
&lt;br /&gt;
Add sleep 15 as shown:&lt;br /&gt;
&lt;br /&gt;
 start() {&lt;br /&gt;
      sleep 15&lt;br /&gt;
      echo -n &amp;quot;Starting $prog: &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Create a symbolic link&lt;br /&gt;
&lt;br /&gt;
 ln -s /etc/zm/apache.conf /etc/apache2/conf-enabled/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Create a new user&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Enable CGI and Zoneminder configuration in Apache.&lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
Note: You may need to edit my.cnf and change the value: sql_mode= to sql_mode=NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 14.04 - ZM 1.26.5 or later to 1.28.107 or the latest PPA version===&lt;br /&gt;
&lt;br /&gt;
Note: 10NOV15 This procedure will not work as the version of Zoneminder in the PPA was removed. It will work for the version in the development PPA (zoneminder-master)&lt;br /&gt;
&lt;br /&gt;
There are a couple of changes you will need to make to get ZM running with version 1.28.107&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Add Repository   (not needed if you are running ZM 1.28.1)&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Upgrade the installation&lt;br /&gt;
&lt;br /&gt;
 apt-get upgrade  (may return nothing to upgrade)&lt;br /&gt;
&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
You will be asked if you want to replace /etc/init.d/zoneminder. Choose &amp;quot;Y&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The database will not automatically update. &lt;br /&gt;
&lt;br /&gt;
Go to the root directory&lt;br /&gt;
 &lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
Create a hidden password file&lt;br /&gt;
&lt;br /&gt;
 nano .my.cnf&lt;br /&gt;
&lt;br /&gt;
Enter this content (but use your MySQL root password!)&lt;br /&gt;
&lt;br /&gt;
 [client]&lt;br /&gt;
 user=root&lt;br /&gt;
 password=(mysqlpass)&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Change permissions in your &amp;quot;ZM database to allow the creation of a table&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;grant select,insert,update,delete,create on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Run the database upgrade&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/zmupdate.pl  &lt;br /&gt;
&lt;br /&gt;
Remove password file&lt;br /&gt;
&lt;br /&gt;
 rm .my.cnf&lt;br /&gt;
&lt;br /&gt;
Add back the delay to allow MySQL to start before Zoneminder&lt;br /&gt;
&lt;br /&gt;
 nano /etc/init.d/zoneminder&lt;br /&gt;
&lt;br /&gt;
Add sleep 15 as shown:&lt;br /&gt;
&lt;br /&gt;
 start() {&lt;br /&gt;
      sleep 15&lt;br /&gt;
      echo -n &amp;quot;Starting $prog: &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Remove symbolic link&lt;br /&gt;
&lt;br /&gt;
 rm /etc/apache2/conf-enabled/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Set permissions of /etc/zm/zm.conf to root:www-data 740&lt;br /&gt;
&lt;br /&gt;
 chmod 740 /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
 chown root:www-data /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Enable Zoneminder and rewrite &lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php5/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit  &lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 restart&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder. Click on Options - Paths &lt;br /&gt;
&lt;br /&gt;
Change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 15.04 - ZM 1.26.5 or later to 1.28.107 or the latest PPA version===&lt;br /&gt;
&lt;br /&gt;
Note: 10NOV15 This procedure will not work as the version of Zoneminder in the PPA was removed. It will work for the version in the development PPA (zoneminder-master)&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Add Repository (not needed if you run 1.27.x or later)&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl stop zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Upgrade the installation&lt;br /&gt;
&lt;br /&gt;
 apt-get upgrade  (may return nothing to upgrade)&lt;br /&gt;
&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
Go to the root dir&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
Create a hidden password file&lt;br /&gt;
&lt;br /&gt;
 nano .my.cnf&lt;br /&gt;
&lt;br /&gt;
Enter this content&lt;br /&gt;
&lt;br /&gt;
 [client]&lt;br /&gt;
 user=root&lt;br /&gt;
 password=(mysqlpass)&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Change permissions in your &amp;quot;ZM database to allow the creation of a table&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;grant select,insert,update,delete,create on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the database upgrade&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/zmupdate.pl  &lt;br /&gt;
&lt;br /&gt;
Remove password file&lt;br /&gt;
&lt;br /&gt;
 rm .my.cnf&lt;br /&gt;
&lt;br /&gt;
Configure Apache&lt;br /&gt;
&lt;br /&gt;
 rm /etc/apache2/conf-enabled/zoneminder.conf &lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php5/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit  &lt;br /&gt;
&lt;br /&gt;
Restart Services&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
 systemctl start zoneminder.service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Open Zoneminder. Click on Options - Paths &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Italic text&amp;#039;&amp;#039;&lt;br /&gt;
Change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
If Zoneminder does not start when you boot your server, run these commands:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop zoneminder.service&lt;br /&gt;
&lt;br /&gt;
 systemctl disable zoneminder.service&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder.service&lt;br /&gt;
&lt;br /&gt;
 systemctl start zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Reboot your server and check that Zoneminder started.&lt;/div&gt;</summary>
		<author><name>Simpler</name></author>
	</entry>
</feed>