Difference between revisions of "Network/zm setup notes"
From Makers Local 256
< Network
Enabrintain (Talk | contribs) (→Overview: added note about hostmane) |
(→Overview: break ldap config into a separate config file to prevent package update issues and tweak for current stable) |
||
Line 3: | Line 3: | ||
Steps to configure a zoneminder integration. | Steps to configure a zoneminder integration. | ||
− | # Install the latest [https://www.debian.org/distrib/ debian] (currently | + | # Install the latest [https://www.debian.org/distrib/ debian] (currently buster) |
## make sure its hostname is "zoneminder" | ## make sure its hostname is "zoneminder" | ||
# As root, install sudo, create a user, add it to sudoers | # As root, install sudo, create a user, add it to sudoers | ||
− | # Install | + | # Install zoneminder |
## sudo apt update | ## sudo apt update | ||
## sudo apt upgrade | ## sudo apt upgrade | ||
## sudo apt dist-upgrade | ## sudo apt dist-upgrade | ||
− | ## sudo apt install php mariadb-server php-mysql libapache2-mod-php7. | + | ## sudo apt install php mariadb-server php-mysql libapache2-mod-php7.3 |
## sudo mysql_secure_installation | ## sudo mysql_secure_installation | ||
## sudo cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf | ## sudo cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf | ||
Line 25: | Line 25: | ||
## sudo apt upgrade | ## sudo apt upgrade | ||
## sudo apt dist-upgrade | ## sudo apt dist-upgrade | ||
− | ## sudo apt install zoneminder vlc-plugin-base php7. | + | ## sudo apt install zoneminder vlc-plugin-base php7.3-gd |
## sudo chmod 740 /etc/zm/zm.conf | ## sudo chmod 740 /etc/zm/zm.conf | ||
## sudo chown root:www-data /etc/zm/zm.conf | ## sudo chown root:www-data /etc/zm/zm.conf | ||
Line 35: | Line 35: | ||
## sudo a2enmod rewrite | ## sudo a2enmod rewrite | ||
## sudo a2enconf zoneminder | ## sudo a2enconf zoneminder | ||
− | ## sudo sed -i "s/;date.timezone =/date.timezone = $(sed 's/\//\\\//' /etc/timezone)/g" /etc/php/7. | + | ## sudo sed -i "s/;date.timezone =/date.timezone = $(sed 's/\//\\\//' /etc/timezone)/g" /etc/php/7.3/apache2/php.ini |
## sudo chown -R www-data:www-data /usr/share/zoneminder/ | ## sudo chown -R www-data:www-data /usr/share/zoneminder/ | ||
## sudo service apache2 restart | ## sudo service apache2 restart | ||
Line 41: | Line 41: | ||
## sudo a2enmod ldap | ## sudo a2enmod ldap | ||
## sudo a2enmod authnz_ldap | ## sudo a2enmod authnz_ldap | ||
− | ## sudo nano /etc/apache2/conf-available/zoneminder.conf | + | ## sudo nano /etc/apache2/conf-available/zoneminder-ml256.conf |
− | ### | + | ### Add the following to the config file |
− | + | ||
− | + | ||
#### <Location /zm> | #### <Location /zm> | ||
#### AuthType Basic | #### AuthType Basic | ||
Line 53: | Line 51: | ||
#### Require valid-user | #### Require valid-user | ||
#### </Location> | #### </Location> | ||
+ | ## sudo a2enconf zoneminder-ml256 | ||
## sudo systemctl status apache2.service | ## sudo systemctl status apache2.service | ||
## sudo systemctl restart apache2 | ## sudo systemctl restart apache2 |
Revision as of 22:08, 5 July 2020
Overview
Steps to configure a zoneminder integration.
- Install the latest debian (currently buster)
- make sure its hostname is "zoneminder"
- As root, install sudo, create a user, add it to sudoers
- Install zoneminder
- sudo apt update
- sudo apt upgrade
- sudo apt dist-upgrade
- sudo apt install php mariadb-server php-mysql libapache2-mod-php7.3
- sudo mysql_secure_installation
- sudo cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf
- sudo nano /etc/mysql/my.cnf
- character-set-server = latin1
- collation-server = latin1_swedish_ci
- sudo service mariadb restart
- sudo nano /etc/apt/sources.list
- deb http://www.deb-multimedia.org stretch main non-free
- sudo apt install deb-multimedia-keyring
- wget http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb
- sudo dpkg -i deb-multimedia-keyring_2016.8.1_all.deb
- sudo apt update
- sudo apt upgrade
- sudo apt dist-upgrade
- sudo apt install zoneminder vlc-plugin-base php7.3-gd
- sudo chmod 740 /etc/zm/zm.conf
- sudo chown root:www-data /etc/zm/zm.conf
- systemctl enable zoneminder.service
- sudo adduser www-data video
- sudo systemctl start zoneminder.service
- sudo systemctl status zoneminder.service
- sudo a2enmod cgi
- sudo a2enmod rewrite
- sudo a2enconf zoneminder
- sudo sed -i "s/;date.timezone =/date.timezone = $(sed 's/\//\\\//' /etc/timezone)/g" /etc/php/7.3/apache2/php.ini
- sudo chown -R www-data:www-data /usr/share/zoneminder/
- sudo service apache2 restart
- Modify zoneminder to use the Makers LDAP
- sudo a2enmod ldap
- sudo a2enmod authnz_ldap
- sudo nano /etc/apache2/conf-available/zoneminder-ml256.conf
- Add the following to the config file
- <Location /zm>
- AuthType Basic
- AuthBasicProvider ldap
- AuthLDAPURL ldap://newldap.256.makerslocal.org/dc=makerslocal,dc=org?uid
- AuthName "LDAP user plz"
- AuthType Basic
- Require valid-user
- </Location>
- Add the following to the config file
- sudo a2enconf zoneminder-ml256
- sudo systemctl status apache2.service
- sudo systemctl restart apache2
- Make new zm pc work in the makers local infrastructure
- sudo hostnamectl set-hostname zoneminder
- sudo vim /etc/network/interfaces -> change nameserver to 10.56.0.1
- sudo vim /etc/network/interfaces -> set the ip to static 10.56.0.19
- auto enp3s0
- iface enp3s0 inet static
- address 10.56.0.19
- gateway 10.56.0.1
- netmask 255.255.255.0
- log into the new ZM using your ML256 creds and modify the options to match the old zm
- ensure the PATH_ZMS on the Paths tab is "/zm/cgi-bin/nph-zms", among other things.
- The PC was then connected to the DMZ net (200) by updating a switch port on the ProCurve switch to use that network.
- Edit /etc/systemd/system$ cd multi-user.target.wants/zoneminder.service
- change 'Restart=on-abnormal' to 'Restart=always' and restart the service.
- The old vm was shut down, and the PC was booted
- Success!
Next Steps
- Soak up the eudaimonia
Deep Gratitude from Phil to:
- Kinsey
- Tyler
- Hunter
Lessons Learned
- the reverse proxy works by mapping shop.ml.org/zm to zoneminder.ml.org
- this is done in nginx on the remoteproxy VM in the /etc/nginx/sites-enabled folder. (specifically the shop.makerslocal.org.conf)
- routing for zoneminder.makerslocal.org is handled by the edge router. it updates its hosts file from reported client hostnames and adds them as fqdns to the network
- this is neat