Difference between revisions of "Shell script zm install"

From ZoneMinder Wiki
Jump to navigationJump to search
(Created page with "This is the contents of the shell script to install the latest Zoneminder from the PPA on Ubuntu 16.04. #!/bin/sh clear read -p "This script installs the latest Zoneminder f...")
 
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
This is the contents of the shell script to install the latest Zoneminder from the PPA on Ubuntu 16.04.
'''Scripts to install Zoneminder on Ubuntu.'''
__TOC__


#!/bin/sh
===Sript for Ubuntu with LAMP (MySQL)===


clear
#!/bin/sh
read -p "This script installs the latest Zoneminder from the PPA for Ubuntu 16.04...Press Enter to continue or Ctrl + c to quit" nothing
clear
clear
read -p "This script installs Zoneminder 1.30.4 on Ubuntu 16.04 AMD64 with LAMP (MySQL) installed...
read -p "Next enter your user password after pressing enter to continue" nothing
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. Press enter to continue" nothing
sudo add-apt-repository ppa:iconnor/zoneminder
sudo apt-get update
clear
read -p "Next we will add settings to MySQL and PHP config files.
Press enter to continue" nothing
awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.0/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
clear
read -p "Now we will install, enable and start Zoneminder.
Press enter to continue" nothing
apt-get install -y zoneminder
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
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


sudo apt-get update
===Sript for Ubuntu which installs Mariadb, Apache2, PHP and Zoneminder (MySQL)===


sudo apt-get -y install mariadb-server mariadb-client apache2 php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache  php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext php-apcu
#!/bin/sh
 
clear
clear
read -p "This script installs the Apache2, Mariadb, PHP and the latest Zoneminder from the PPA for Ubuntu 16.04...Press Enter to continue or Ctrl + c to quit" nothing
read -p "Next secure mariadb server by entering requested information. Press enter to continue" nothing
clear
sudo mysql_secure_installation
read -p "You must be logged in as root using sudo su ...
 
Press Enter to continue or Ctrl + c to quit" nothing
read -p "Next we will add the PPA repository. Press enter to continue" nothing
clear
 
apt -y install mariadb-server mariadb-client apache2 php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache  php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext php-apcu
sudo add-apt-repository ppa:iconnor/zoneminder
clear
 
read -p "Next secure mariadb server by entering requested information. Press enter to continue" nothing
sudo apt-get update
mysql_secure_installation
 
clear
sudo apt-get -y install zoneminder php-gd
read -p "Next we will add the PPA repository. Press enter to continue" nothing
 
apt -y install software-properties-common
sudo chmod 740 /etc/zm/zm.conf
add-apt-repository ppa:iconnor/zoneminder
 
apt update
sudo chown root:www-data /etc/zm/zm.conf
apt -y install zoneminder php-gd
 
chmod 740 /etc/zm/zm.conf
sudo adduser www-data video
chown root:www-data /etc/zm/zm.conf
 
adduser www-data video
sudo a2enmod cgi
a2enmod cgi
 
a2enconf zoneminder
sudo a2enconf zoneminder
a2enmod rewrite
 
chown -R www-data:www-data /usr/share/zoneminder/
sudo a2enmod rewrite
systemctl enable zoneminder
 
service zoneminder start
sudo chown -R www-data:www-data /usr/share/zoneminder/
clear
 
awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.0/apache2/php.ini
sudo systemctl enable zoneminder
sudo service apache2 reload
 
clear
sudo service zoneminder start
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
read -p "Next we will add timezone yo PHP. Nano will open, search for :date.timezone = and make it look like date.timezone = America/New_York Press enter to continue" nothing
 
sudo nano /etc/php/7.0/apache2/php.ini
 
sudo 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
read -p " if you plan to use the API go to https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.0_the_easy_way and follow the instructions for the API fix. Press Enter to finish." nothing

Latest revision as of 18:19, 9 June 2018

Scripts to install Zoneminder on Ubuntu.

Sript for Ubuntu with LAMP (MySQL)

#!/bin/sh
clear
read -p "This script installs Zoneminder 1.30.4 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. Press enter to continue" nothing
sudo add-apt-repository ppa:iconnor/zoneminder
sudo apt-get update
clear
read -p "Next we will add settings to MySQL and PHP config files. 
Press enter to continue" nothing
awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.0/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
clear
read -p "Now we will install, enable and start Zoneminder. 
Press enter to continue" nothing
apt-get install -y zoneminder
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
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

Sript for Ubuntu which installs Mariadb, Apache2, PHP and Zoneminder (MySQL)

#!/bin/sh
clear
read -p "This script installs the Apache2, Mariadb, PHP and the latest Zoneminder from the PPA for 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
apt -y install mariadb-server mariadb-client apache2 php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-gd  php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache  php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext php-apcu
clear
read -p "Next secure mariadb server by entering requested information. Press enter to continue" nothing
mysql_secure_installation
clear 
read -p "Next we will add the PPA repository. Press enter to continue" nothing
apt -y install software-properties-common
add-apt-repository ppa:iconnor/zoneminder
apt update
apt -y install zoneminder php-gd
chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
adduser www-data video
a2enmod cgi
a2enconf zoneminder
a2enmod rewrite
chown -R www-data:www-data /usr/share/zoneminder/
systemctl enable zoneminder
service zoneminder start
clear
awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.0/apache2/php.ini
sudo 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