|
|
Line 1: |
Line 1: |
| Shell script zm-install-bionic
| | Zoneminder 1.30.4 made it into the "official" Ubuntu 18.10 repositories. You will need to install LAMP then secure MySQL before installing Zoneminder. I use a very minimum install from the 18.10 mini.iso. |
|
| |
|
| __TOC__
| | Here are the basic commands you will need. As always start from a root (sudo su) prompt. |
|
| |
|
| ===Script for Ubuntu 18.04 with LAMP(MySQL) Zoneminder 1.30.4===
| | mysql_secure_installation |
|
| |
|
| #!/bin/sh
| | nano /etc/mysql/my.cnf |
| clear
| |
| read -p "This script installs Zoneminder 1.30.4 on Ubuntu 18.04 AMD64 with LAMP (MySQL) installed...
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| clear
| |
| read -p "You must be logged in as root using sudo su ...
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| clear
| |
| read -p "Next secure MySQL server by entering requested information. Press enter to continue" nothing
| |
| mysql_secure_installation
| |
| read -p "Next we will download the Zoneminder install package and install it.
| |
| Press enter to continue" nothing
| |
| wget --no-check-certificate https://173.163.189.225/zoneminder-1.30.4-bionic-amd64.deb -P /tmp/
| |
| ls /tmp/zoneminder*
| |
| read -p "Check above to be sure the file downloaded. Should be:
| |
| /tmp/zoneminder-1.30.4-bionic-amd64.deb (5686708)
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| clear
| |
| awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.2/apache2/php.ini
| |
| echo "[mysqld]" >> /etc/mysql/my.cnf
| |
| echo "init_connect = 'SET @@sql_mode = CASE CURRENT_USER() WHEN \'zmuser@localhost\' THEN \'NO_ENGINE_SUBSTITUTION\' ELSE @@sql_mode END;'" >> /etc/mysql/my.cnf
| |
| systemctl restart mysql
| |
| apt-get -y install /tmp/zoneminder-1.30.4-bionic-amd64.deb
| |
| systemctl enable zoneminder
| |
| service zoneminder start
| |
| adduser www-data video
| |
| a2enmod cgi
| |
| a2enconf zoneminder
| |
| a2enmod rewrite
| |
| chown -R www-data:www-data /usr/share/zoneminder/
| |
| service apache2 reload
| |
| clear
| |
| read -p "Open Zoneminder in a web browser (http://server-ip/zm).
| |
| Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms
| |
| Click the Save button.
| |
| Press enter to continue" nothing
| |
| clear
| |
|
| |
|
| ===Script for Ubuntu 18.04 - will install Apache, Mariadb, PHP and Zoneminder 1.30.4===
| | [mysqld] |
| #!/bin/sh
| | sql_mode = NO_ENGINE_SUBSTITUTION |
| clear
| |
| read -p "This script installs Apache, Mariadb, PHP, and Zoneminder 1.30.4 on Ubuntu 18.04 AMD64
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| clear
| |
| read -p "You must be logged in as root using sudo su ...
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| clear
| |
| read -p "Next we will install Apache, Mariadb Server and PHP
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| apt update
| |
| apt -y install apache2 mariadb-server mariadb-client php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-intl php7.2-mysql php7.2-cli php7.2-zip php7.2-curl
| |
| clear
| |
| read -p "Next secure mariadb server by entering requested information. Press enter to continue" nothing
| |
| mysql_secure_installation
| |
| wget --no-check-certificate https://173.163.189.225/zoneminder-1.30.4-bionic-amd64.deb -P /tmp/
| |
| awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.2/apache2/php.ini
| |
| apt-get -y install /tmp/zoneminder-1.30.4-bionic-amd64.deb
| |
| systemctl enable zoneminder
| |
| service zoneminder start
| |
| adduser www-data video
| |
| a2enmod cgi
| |
| a2enconf zoneminder
| |
| a2enmod rewrite
| |
| chown -R www-data:www-data /usr/share/zoneminder/
| |
| service apache2 reload
| |
| clear
| |
| read -p "Open Zoneminder in a web browser (http://server-ip/zm).
| |
| Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms
| |
| Click the Save button.
| |
| Press enter to continue" nothing
| |
| clear
| |
|
| |
|
| ===Script to patch upgrade from Ubuntu 16.04 to 18.04. Works with MySQL or Mariadb (MySQL)===
| | apt install zoneminder |
| #!/bin/sh
| |
| clear
| |
| read -p "This script updates Zoneminder 1.30.4 on Ubuntu 18.04 with LAMP (MySQL) after an upgrade from Ubuntu 16.04...
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| clear
| |
| read -p "You must be logged in as root using sudo su ...
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| clear
| |
| read -p "Next we will download the Zoneminder install package. This may take a minute to connect
| |
| Press enter to continue" nothing
| |
| wget --no-check-certificate https://173.163.189.225/zoneminder-1.30.4-bionic-amd64.deb -P /tmp/
| |
| ls /tmp/zoneminder*
| |
| read -p "Check above to be sure the file downloaded. Should be:
| |
| /tmp/zoneminder-1.30.4-bionic-amd64.deb (5686708)
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| clear
| |
| read -p "Next we will add settings to PHP config files.
| |
| Press enter to continue" nothing
| |
| awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.2/apache2/php.ini
| |
| clear
| |
| read -p "Now we will upgrade, enable and start Zoneminder.
| |
| Press enter to continue" nothing
| |
| apt-get -y --allow-downgrades install /tmp/zoneminder-1.30.4-bionic-amd64.deb
| |
| systemctl enable zoneminder
| |
| service zoneminder start
| |
| a2enmod php7.2
| |
| a2enmod cgi
| |
| a2enconf zoneminder
| |
| a2enmod rewrite
| |
| chown -R www-data:www-data /usr/share/zoneminder/
| |
| service apache2 reload
| |
| clear
| |
| read -p "Open Zoneminder in a web browser (http://server-ip/zm).
| |
| Click on Options - Paths and chech that PATH_ZMS is /zm/cgi-bin/nph-zms
| |
| Click the Save button.
| |
| Press enter to continue" nothing
| |
| clear
| |
|
| |
|
| | mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql |
|
| |
|
| ===Script for Ubuntu 16.04 with LAMP(MySQL) Zoneminder 1.32.0===
| | mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';" |
| #!/bin/sh
| |
| clear
| |
| read -p "This script installs Zoneminder 1.32.0 on Ubuntu 16.04 AMD64 with LAMP (MySQL) installed...
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| clear
| |
| read -p "You must be logged in as root using sudo su ...
| |
| Press Enter to continue or Ctrl + c to quit" nothing
| |
| clear
| |
| read -p "Next we will add the PPA repository, install and configure the system to run Zoneminder.
| |
| Press enter to continue" nothing
| |
| apt install -y software-properties-common
| |
| clear
| |
| add-apt-repository ppa:iconnor/zoneminder
| |
| apt update
| |
| clear
| |
| awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.0/apache2/php.ini
| |
| clear
| |
| apt install -y zoneminder
| |
| systemctl enable zoneminder
| |
| service zoneminder start
| |
| adduser www-data video
| |
| a2enconf zoneminder
| |
| a2enmod rewrite
| |
| chown -R www-data:www-data /usr/share/zoneminder/
| |
| service apache2 reload
| |
| clear
| |
| read -p "Install complete.Press enter to continue" nothing
| |
| clear
| |
|
| |
|
| ===Script for Ubuntu 18.04 with LAMP(MySQL) Zoneminder 1.32.0===
| | mysqladmin -uroot -p reload |
| #!/bin/sh
| | |
| clear
| | chmod 740 /etc/zm/zm.conf |
| read -p "This script installs Zoneminder 1.32.0 on Ubuntu 18.04 AMD64 with LAMP (MySQL) installed...
| | |
| Press Enter to continue or Ctrl + c to quit" nothing
| | chown root:www-data /etc/zm/zm.conf |
| clear
| | |
| read -p "You must be logged in as root using sudo su ...
| | systemctl enable zoneminder.service |
| Press Enter to continue or Ctrl + c to quit" nothing
| | |
| clear
| | adduser www-data video |
| read -p "Next we will add the PPA repository, install and configure the system to run Zoneminder.
| | |
| Press enter to continue" nothing
| | a2enmod cgi |
| apt install -y software-properties-common
| | |
| add-apt-repository ppa:iconnor/zoneminder
| | a2enmod rewrite |
| clear
| | |
| awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.2/apache2/php.ini
| | a2enconf zoneminder |
| clear
| | |
| apt install -y zoneminder
| | nano /etc/php/7.2/apache2/php.ini |
| systemctl enable zoneminder
| | |
| service zoneminder start
| | chown -R www-data:www-data /usr/share/zoneminder/ |
| adduser www-data video
| | |
| a2enconf zoneminder
| | service apache2 restart |
| a2enmod rewrite
| |
| chown -R www-data:www-data /usr/share/zoneminder/
| |
| service apache2 reload
| |
| read -p "Install complete.Press enter to continue" nothing
| |
| clear
| |
Zoneminder 1.30.4 made it into the "official" Ubuntu 18.10 repositories. You will need to install LAMP then secure MySQL before installing Zoneminder. I use a very minimum install from the 18.10 mini.iso.
Here are the basic commands you will need. As always start from a root (sudo su) prompt.
mysql_secure_installation
nano /etc/mysql/my.cnf
[mysqld]
sql_mode = NO_ENGINE_SUBSTITUTION
apt install zoneminder
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
systemctl enable zoneminder.service
adduser www-data video
a2enmod cgi
a2enmod rewrite
a2enconf zoneminder
nano /etc/php/7.2/apache2/php.ini
chown -R www-data:www-data /usr/share/zoneminder/
service apache2 restart