<?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=Mjn</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=Mjn"/>
	<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/Special:Contributions/Mjn"/>
	<updated>2026-05-04T00:43:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.29.0_the_easy_way&amp;diff=7643</id>
		<title>Ubuntu Server 16.04 64-bit with Zoneminder 1.29.0 the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.29.0_the_easy_way&amp;diff=7643"/>
		<updated>2016-04-29T16:38:18Z</updated>

		<summary type="html">&lt;p&gt;Mjn: /* Ubuntu 16.04 with LAMP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Ubuntu 16.04 is released and I have verified the Zoneminder install with teh default LAMP!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 16.04 with LAMP===&lt;br /&gt;
&lt;br /&gt;
Install Basic Server (if you used the mini.iso), OpenSSH Server, and LAMP Server (This procedure uses the default MySQL 5.7.)&lt;br /&gt;
&lt;br /&gt;
If you get a blank screen after installing Ubuntu 16.04, press Alt + F1 to open a console.&lt;br /&gt;
&lt;br /&gt;
Log in then become root:&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Make sure you are up to date&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
At this point you should have Ubuntu 16.04 installed with LAMP which includes the default MySQL 5.7. You have the option to use Mariadb Server 10.0 which will replace MySQL 5.7 (Click on Options link in Contents above) or continue with MySQL 5.7..&lt;br /&gt;
&lt;br /&gt;
You will need to make a settings change to MySQL as follows:&lt;br /&gt;
&lt;br /&gt;
Note: The MySQL default configuration file (/etc/mysql/mysql.cnf)is read through several symbolic links beginning with /etc/mysql/my.cnf as follows:&lt;br /&gt;
/etc/mysql/my.cnf -&amp;gt; /etc/alternatives/my.cnf&lt;br /&gt;
/etc/alternatives/my.cnf -&amp;gt; /etc/mysql/mysql.cnf&lt;br /&gt;
&lt;br /&gt;
/etc/mysql/mysql.cnf is a basic file&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;
&lt;br /&gt;
Optional: A tool that you may want to install is mysqltuner. This is handy to see what database parameters need to be adjusted as your ZM system builds up events.&lt;br /&gt;
&lt;br /&gt;
 apt-get install mysqltuner&lt;br /&gt;
&lt;br /&gt;
Once installed, run mysqltuner from a command prompt as root (sudo). Review recommended changes. Edit the configuration file (my.cnf) and make the recommended changes. Stop zoneminder, restart the database server then start zoneminder.&lt;br /&gt;
&lt;br /&gt;
===Install Zoneminder===&lt;br /&gt;
&lt;br /&gt;
 apt-get install zoneminder php-gd&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;
 mysql -uroot -p &amp;lt; /usr/share/zoneminder/db/zm_create.sql&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;
 mysqladmin -uroot -p reload&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;
Create a new user&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Enable CGI, Zoneminder and rewrite 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;
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 None to All 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;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit  &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;
Add timezone to PHP&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;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder in a web browser (http://server-ip/zm).&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
===Optional Upgrade to MariaDB Server 10.0. before installing Zoneminder===&lt;br /&gt;
&lt;br /&gt;
MariaDB has some enhanced features which do not exist in MySQL and thus migration back to MySQL might not always work.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note: This procedure is to upgrade to Mariadb before installing Zoneminder!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Upgrade the LAMP installed MySQL 5.7 to Mariadb with the command:&lt;br /&gt;
&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
&lt;br /&gt;
Secure Mariadb, create root password et. al.&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Note: The MySQL/MariaDB configuration file is located at: /etc/mysql/mysql.conf.d/mysqld.cnf To better manage the MariaDB server I recommend you move the config file and replace the default my.cnf symbolic link (this also works for MySQL 5.6).&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;
To change Mariadb settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&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;
A tool that you may want to install is mysqltuner. This is handy to see what database paramaters need to be adjusted as your ZM system builds up events.&lt;br /&gt;
&lt;br /&gt;
 apt-get install mysqltuner&lt;br /&gt;
&lt;br /&gt;
Continue installing Zoneminder: https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.29.0_the_easy_way#Install_Zoneminder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a link to manually install LAMP with Mariadb server  [[Install MariaDB Server 10.0]]&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
===Optional Upgrade to MariaDB Server 10.0. with Zoneminder (or other databases) installed===&lt;br /&gt;
&lt;br /&gt;
Note: This procedure is concerned with backing up and recreating the Zoneminder database. You can use the same commands, with other database names, if your system has other databases running in MySQL.&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Backup Zoneminder database (or other databases)&lt;br /&gt;
&lt;br /&gt;
 mysqldump -uroot -p zm &amp;gt; zm.sql&lt;br /&gt;
&lt;br /&gt;
Upgrade the LAMP installed MySQL 5.7 to Mariadb with the command:&lt;br /&gt;
&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
&lt;br /&gt;
Secure Mariadb, create root password et. al.&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Note: The MySQL/MariaDB configuration file is located at: /etc/mysql/mysql.conf.d/mysqld.cnf To better manage the MariaDB server I recommend you move the config file and replace the default my.cnf symbolic link.&lt;br /&gt;
&lt;br /&gt;
Remove the current symbolic link&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  &lt;br /&gt;
&lt;br /&gt;
Create new my.cnf&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;
To change Mariadb settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&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 new empty zm database&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p&lt;br /&gt;
&lt;br /&gt;
You are now in the Mariadb console&lt;br /&gt;
&lt;br /&gt;
 CREATE DATABASE zm;&lt;br /&gt;
&lt;br /&gt;
Quit Mariadb console&lt;br /&gt;
&lt;br /&gt;
 \q&lt;br /&gt;
&lt;br /&gt;
Restore zm database from backup&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;
Start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
You should now be running Mariadb server!&lt;/div&gt;</summary>
		<author><name>Mjn</name></author>
	</entry>
</feed>