reorganize files to allow el6 and el7 files to exist simultaneously

pull/700/head
Andrew Bauer 2015-02-08 17:56:44 -06:00
parent d449d00569
commit c619dded76
11 changed files with 84 additions and 24 deletions

View File

@ -1,7 +1,11 @@
# CMakeLists.txt for the Redhat/CentOS Target Distro.
# Create the zoneminder service file
configure_file(zoneminder.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY)
if(ZM_TARGET_DISTRO STREQUAL "el7")
configure_file(zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY)
else
configure_file(zoneminder.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder @ONLY)
endif(ZM_TARGET_DISTRO STREQUAL "el7")
# Download jscalendar & move files into position
file(DOWNLOAD http://softlayer-dal.dl.sourceforge.net/project/jscalendar/jscalendar/1.0/jscalendar-1.0.zip ${CMAKE_CURRENT_SOURCE_DIR}/jscalendar-1.0.zip LOG jsc_log STATUS download_jsc)
@ -41,10 +45,16 @@ install(CODE "execute_process(COMMAND ln -sf ../../../../var/lib/zoneminder/imag
install(CODE "execute_process(COMMAND ln -sf ../../../../var/lib/zoneminder/temp \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/temp\")")
# Install auxillary files required to run zoneminder on CentOS
install(FILES zoneminder.conf DESTINATION /etc/httpd/conf.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
install(FILES zm-logrotate_d DESTINATION /etc/logrotate.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
install(FILES redalert.wav DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/sounds PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES zoneminder.service DESTINATION /etc/rc.d/init.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
if(ZM_TARGET_DISTRO STREQUAL "el7")
install(FILES zoneminder.el7.conf DESTINATION /etc/httpd/conf.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
install(FILES zoneminder.el7.logrotate DESTINATION /etc/logrotate.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
install(FILES zoneminder.service DESTINATION /usr/lib/systemd/system PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
else
install(FILES zoneminder.el6.conf DESTINATION /etc/httpd/conf.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
install(FILES zoneminder.el6.logrotate DESTINATION /etc/logrotate.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
install(FILES zoneminder DESTINATION /etc/rc.d/init.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
endif(ZM_TARGET_DISTRO STREQUAL "el7")
# Install jscalendar
if(unzip_jsc STREQUAL "")

0
distros/redhat/redalert.wav Executable file → Normal file
View File

View File

@ -1,6 +1,3 @@
# The Zoneminder web interface has been disabled by default due to a small
# security issue in the default install.
#
# When using Zoneminder's own authentication, recorded CCTV images are
# accessible from the web directly without passing the authentication. This
# means any attacker could see your CCTV images without a password. In order
@ -18,10 +15,8 @@ Alias /zm "/usr/share/zoneminder/www"
AllowOverride All
Order allow,deny
Allow from all
# The code unfortunately uses short tags in many places
php_value short_open_tag 1
Deny from all # DELETE THIS LINE
# ZoneMinder no longer uses short tags so this is safe to leave disabled
# php_value short_open_tag 1
</Directory>
ScriptAlias /cgi-bin/zm "/usr/libexec/zoneminder/cgi-bin"

View File

@ -0,0 +1,42 @@
# When using Zoneminder's own authentication, recorded CCTV images are
# accessible from the web directly without passing the authentication. This
# means any attacker could see your CCTV images without a password. In order
# to avoid this you can disable Zoneminder's authentication and configure
# standard Apache authentication (see the Apache documentation for details on
# this).
#
# If you still wish to use Zoneminder's own authentication, or have an
# internal site which needs no authentication, you need to delete the line
# marked below and restart Apache.
Alias /zm "/usr/share/zoneminder/www"
<Directory "/usr/share/zoneminder/www">
Options -Indexes +MultiViews +FollowSymLinks
AllowOverride All
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order deny,allow
Allow from all
</IfModule>
# ZoneMinder no longer uses short tags so this is safe to leave disabled
# php_value short_open_tag 1
</Directory>
ScriptAlias /cgi-bin/zm "/usr/libexec/zoneminder/cgi-bin"
<Directory "/usr/libexec/zoneminder/cgi-bin">
AllowOverride All
Options ExecCGI
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order deny,allow
Allow from all
</IfModule>
</Directory>

View File

@ -0,0 +1,8 @@
/var/log/zoneminder/*.log {
missingok
notifempty
sharedscripts
postrotate
/usr/bin/zmpkg.pl logrot 2> /dev/null > /dev/null || :
endscript
}

0
distros/redhat/zoneminder.in Executable file → Normal file
View File

View File

@ -1,13 +0,0 @@
[Unit]
Description=Video security and surveillance system
After=mysqld.service
[Service]
Type=forking
ExecStart=/usr/bin/zmpkg.pl start
ExecReload=/usr/bin/zmpkg.pl reload
PIDFile=/run/zoneminder/zm.pid
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,18 @@
# ZoneMinder systemd unit file for CentOS 7
[Unit]
Description=ZoneMinder CCTV recording and security system
After=network.target mariadb.service httpd.service
Requires=mariadb.service httpd.service
[Service]
User=@WEB_USER@
Type=forking
ExecStart=@BINDIR@/zmpkg.pl start
ExecReload=@BINDIR@/zmpkg.pl restart
ExecStop=@BINDIR@/zmpkg.pl stop
PIDFile="@ZM_RUNDIR@/zm.pid"
[Install]
WantedBy=multi-user.target