From b99e7b6500af82ed5bb616b8850760c7eb43ccce Mon Sep 17 00:00:00 2001 From: Sander Alberink Date: Mon, 1 Feb 2016 12:34:09 +0100 Subject: [PATCH 1/7] Prepare for new Apache 2.4 behviour in Trusty --- utils/docker/apache-vhost | 3 +-- utils/docker/phpdate.ini | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 utils/docker/phpdate.ini diff --git a/utils/docker/apache-vhost b/utils/docker/apache-vhost index 622e4b5e4..5f59c01b2 100644 --- a/utils/docker/apache-vhost +++ b/utils/docker/apache-vhost @@ -6,8 +6,7 @@ AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch - Order allow,deny - Allow from all + require all granted diff --git a/utils/docker/phpdate.ini b/utils/docker/phpdate.ini new file mode 100644 index 000000000..50f2cca0f --- /dev/null +++ b/utils/docker/phpdate.ini @@ -0,0 +1,5 @@ +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +date.timezone = Europe/Amsterdam + From baa305c0ed90fe23a4185b624a1272d1486bb4b6 Mon Sep 17 00:00:00 2001 From: Sander Alberink Date: Mon, 1 Feb 2016 12:35:45 +0100 Subject: [PATCH 2/7] Increase shared memory available in docker to ensure H.264 cameras can work Also enable CGI module, as zoneminder needs this for monitors --- utils/docker/start.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/docker/start.sh b/utils/docker/start.sh index 76ad3dcbb..e5730c279 100644 --- a/utils/docker/start.sh +++ b/utils/docker/start.sh @@ -1,5 +1,9 @@ #!/bin/bash +# Prepare proper amount of shared memory +umount /dev/shm +mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=2048M tmpfs /dev/shm + # Start MySQL /usr/bin/mysqld_safe & @@ -27,6 +31,9 @@ mysql -u root < db/zm_create.sql # Add the ZoneMinder DB user mysql -u root -e "grant insert,select,update,delete,lock tables,alter on zm.* to 'zm'@'localhost' identified by 'zm'" +# Activate CGI +a2enmod cgi + # Restart apache service apache2 restart From bd3e79015bf61ffd282d18f204fac3d6a2fcac9e Mon Sep 17 00:00:00 2001 From: Sander Alberink Date: Mon, 1 Feb 2016 12:39:43 +0100 Subject: [PATCH 3/7] Fix Dockerfile - migrate to Ubuntu Trusty Tahr, which is the latest LTS release - add a user that is allowed to login via SSH - Fix apache configuration --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 382330a09..fd41464fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # ZoneMinder -FROM ubuntu:precise +FROM ubuntu:trusty MAINTAINER Kyle Johnson # Let the container know that there is no tty @@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y \ libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf libjpeg-turbo8-dev \ libjpeg-turbo8 libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev libav-tools mysql-client \ apache2 php5 php5-mysql apache2-mpm-prefork libapache2-mod-php5 php5-cli openssh-server \ - mysql-server libvlc-dev libvlc5 libvlccore-dev libvlccore5 vlc-data libcurl4-openssl-dev \ + mysql-server libvlc-dev libvlc5 libvlccore-dev libvlccore7 vlc-data libcurl4-openssl-dev \ libavformat-dev libswscale-dev libavutil-dev libavcodec-dev libavfilter-dev \ libavresample-dev libavdevice-dev libpostproc-dev libv4l-dev libtool libnetpbm10-dev \ libmime-lite-perl dh-autoreconf dpatch @@ -47,11 +47,16 @@ RUN chmod 755 /tmp/start.sh RUN mkdir /var/run/sshd # Adding apache virtual hosts file -ADD utils/docker/apache-vhost /etc/apache2/sites-enabled/000-default +ADD utils/docker/apache-vhost /etc/apache2/sites-available/000-default.conf +ADD utils/docker/phpdate.ini /etc/php5/apache2/conf.d/25-phpdate.ini # Set the root passwd RUN echo 'root:root' | chpasswd +# Add a user we can actually login with +RUN useradd -m -s /bin/bash -G sudo zoneminder +RUN echo 'zoneminder:zoneminder' | chpasswd + # Expose ssh and http ports EXPOSE 80 EXPOSE 22 From b0c5aa511a9d8cb1128738f48f0c113973a6de72 Mon Sep 17 00:00:00 2001 From: Sander Alberink Date: Fri, 5 Feb 2016 14:02:20 +0100 Subject: [PATCH 4/7] Migrate to cmake for building. Also ensure that content is properly symlinked. --- Dockerfile | 13 ++++++++++--- utils/docker/start.sh | 5 ++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index fd41464fe..46b3dac5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y \ libpolkit-gobject-1-dev build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev \ libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 \ - libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf libjpeg-turbo8-dev \ + libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm cmake libjpeg-turbo8-dev \ libjpeg-turbo8 libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev libav-tools mysql-client \ apache2 php5 php5-mysql apache2-mpm-prefork libapache2-mod-php5 php5-cli openssh-server \ mysql-server libvlc-dev libvlc5 libvlccore-dev libvlccore7 vlc-data libcurl4-openssl-dev \ @@ -25,10 +25,11 @@ ADD . /ZoneMinder WORKDIR /ZoneMinder # Setup the ZoneMinder build environment -RUN aclocal && autoheader && automake --force-missing --add-missing && autoconf +#RUN aclocal && autoheader && automake --force-missing --add-missing && autoconf # Configure ZoneMinder -RUN ./configure --with-libarch=lib/$DEB_HOST_GNU_TYPE --disable-debug --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --with-mysql=/usr --with-webdir=/var/www/zm --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-mmap=yes ZM_SSL_LIB=openssl ZM_DB_USER=zm ZM_DB_PASS=zm +#RUN ./configure --with-libarch=lib/$DEB_HOST_GNU_TYPE --disable-debug --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --with-mysql=/usr --with-webdir=/var/www/zm --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-mmap=yes --enable-onvif ZM_SSL_LIB=openssl ZM_DB_USER=zm ZM_DB_PASS=zm +RUN cmake . # Build ZoneMinder RUN make @@ -36,6 +37,9 @@ RUN make # Install ZoneMinder RUN make install +# ensure writable folders +RUN ./zmlinkcontent.sh + # Adding the start script ADD utils/docker/start.sh /tmp/start.sh @@ -43,6 +47,9 @@ ADD utils/docker/start.sh /tmp/start.sh # TODO - Files ADD'ed have 755 already...why do we need this? RUN chmod 755 /tmp/start.sh +# give files in /usr/local/share/zoneminder/ +RUN chown -R www-data:www-data /usr/local/share/zoneminder/ + # Creating SSH privledge escalation dir RUN mkdir /var/run/sshd diff --git a/utils/docker/start.sh b/utils/docker/start.sh index e5730c279..4b6c0e379 100644 --- a/utils/docker/start.sh +++ b/utils/docker/start.sh @@ -29,11 +29,14 @@ done mysql -u root < db/zm_create.sql # Add the ZoneMinder DB user -mysql -u root -e "grant insert,select,update,delete,lock tables,alter on zm.* to 'zm'@'localhost' identified by 'zm'" +mysql -u root -e "grant insert,select,update,delete,lock tables,alter on zm.* to 'zmuser'@'localhost' identified by 'zmpass';" # Activate CGI a2enmod cgi +# Activate modrewrite +a2enmod rewrite + # Restart apache service apache2 restart From e01547cbe497794ade2e3f9e9abc9eb3d98bc386 Mon Sep 17 00:00:00 2001 From: Sander Alberink Date: Fri, 5 Feb 2016 14:08:43 +0100 Subject: [PATCH 5/7] Update timezone to GMT, reduce SHM requirement to 512M Increase the SHM to 2048 if you need to support H.264 cameras --- utils/docker/phpdate.ini | 2 +- utils/docker/start.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/docker/phpdate.ini b/utils/docker/phpdate.ini index 50f2cca0f..d35b47361 100644 --- a/utils/docker/phpdate.ini +++ b/utils/docker/phpdate.ini @@ -1,5 +1,5 @@ [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone -date.timezone = Europe/Amsterdam +date.timezone = GMT diff --git a/utils/docker/start.sh b/utils/docker/start.sh index 4b6c0e379..0772f7b9b 100644 --- a/utils/docker/start.sh +++ b/utils/docker/start.sh @@ -1,8 +1,10 @@ #!/bin/bash # Prepare proper amount of shared memory +# For H.264 cameras it may be necessary to increase the amout of shared memory +# to 2048 megabytes. umount /dev/shm -mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=2048M tmpfs /dev/shm +mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=512M tmpfs /dev/shm # Start MySQL /usr/bin/mysqld_safe & From a2ae29dfbe9da71b1f15ff6df0b9de7b080cf4e2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 8 Feb 2016 09:47:52 -0500 Subject: [PATCH 6/7] Add php5-gd to depends --- distros/ubuntu1204_cmake/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/ubuntu1204_cmake/control b/distros/ubuntu1204_cmake/control index 4b4877562..fd7a53049 100644 --- a/distros/ubuntu1204_cmake/control +++ b/distros/ubuntu1204_cmake/control @@ -51,7 +51,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,libwww-perl ,mysql-client | virtual-mysql-client ,perl-modules - ,php5-mysql + ,php5-mysql, php5-gd ,policykit-1 ,rsyslog | system-log-daemon ,zip From 5f217b48e02096bc28387555c94410db4355dcbf Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 12 Feb 2016 13:52:59 -0500 Subject: [PATCH 7/7] When Protocol is HTTP, hide the RTSPDescribe line. Make it appear when Protocol is changed to RTSP --- web/skins/classic/views/monitor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index e716210ab..2b2b6375d 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -787,7 +787,7 @@ switch ( $tab ) elseif ( $newMonitor['Type'] == "Remote" ) { ?> - + -  () checked="checked"/> + > () checked="checked"/>