2013-09-16 05:33:09 +08:00
|
|
|
New installs
|
|
|
|
============
|
|
|
|
|
|
|
|
1. Unless you are already using the MySQL server or you are running it
|
|
|
|
remotely you will need to ensure that the server is installed and secured:
|
|
|
|
|
2013-09-29 04:18:45 +08:00
|
|
|
yum install mysql-community-server
|
|
|
|
--OR--
|
|
|
|
yum install mariadb-server
|
2013-09-16 21:21:37 +08:00
|
|
|
|
2013-09-29 04:18:45 +08:00
|
|
|
sudo systemctl enable mysqld
|
2013-09-16 21:21:37 +08:00
|
|
|
|
2013-09-29 04:18:45 +08:00
|
|
|
sudo system start mysqld
|
2013-09-16 21:21:37 +08:00
|
|
|
|
2013-09-29 04:18:45 +08:00
|
|
|
mysql_secure_installation
|
2013-09-16 05:33:09 +08:00
|
|
|
|
2013-09-29 04:18:45 +08:00
|
|
|
2. Using the password for the root account set during the previous step, you
|
2013-10-06 06:21:30 +08:00
|
|
|
will need to create the ZoneMinder database, assuming your database server
|
|
|
|
is local:
|
2013-09-16 05:33:09 +08:00
|
|
|
|
|
|
|
mysql -u root -p < /usr/share/zoneminder/db/zm_create.sql
|
|
|
|
mysqladmin reload
|
|
|
|
|
|
|
|
3. The database needs a user. One is not created by default because this would
|
|
|
|
introduce an obvious security issue. The following should set this up:
|
|
|
|
|
|
|
|
mysql -u root -p
|
2013-10-06 06:21:30 +08:00
|
|
|
grant select,insert,update,delete,alter on zm.* to
|
|
|
|
'zmuser'@localhost identified by 'zmpass';
|
2013-09-16 05:33:09 +08:00
|
|
|
|
|
|
|
Obviously, change at least zmpass to an actual, secure password or
|
|
|
|
passphrase. You can change zmuser as well if you like.
|
|
|
|
|
|
|
|
4. Edit /etc/zm.conf and, at the bottom, change ZM_DB_PASS and perhaps
|
|
|
|
ZM_DB_USER to match.
|
|
|
|
|
|
|
|
5. Edit /etc/php.ini, uncomment the date.timezone line, and add your local
|
|
|
|
timezone. For whatever reason, PHP will complain loudly if this is not set,
|
|
|
|
or if it is set incorrectly, and these complaints will show up in the
|
|
|
|
zoneminder logging system as errors.
|
|
|
|
|
2013-09-16 21:21:37 +08:00
|
|
|
If you are not sure of the proper timezone specification to use, look at
|
|
|
|
http://php.net/date.timezone
|
2013-09-16 05:33:09 +08:00
|
|
|
|
|
|
|
6. This package probably does not work with SELinux enabled at the moment. It
|
|
|
|
may be necessary to disable SELinux for httpd, or even completely for
|
|
|
|
ZoneMinder to function. This will be addressed in a later release. Run
|
|
|
|
|
|
|
|
setenforce 0
|
|
|
|
|
|
|
|
for testing, and edit /etc/sysconfig/selinux to disable it at boot time.
|
|
|
|
|
2013-09-29 04:18:45 +08:00
|
|
|
7. IMPORTANT: Edit /etc/httpd/conf.d/zoneminder.conf and/or /etc/httpd/conf.
|
2013-09-16 05:33:09 +08:00
|
|
|
|
2013-09-29 04:18:45 +08:00
|
|
|
The httpd.conf file included with this version of Fedora processes the conf.d
|
|
|
|
folder after the default ScriptAlias directive in the httpd.conf file.
|
|
|
|
Previously, the conf.d folder was processed before the default ScriptAlias
|
2013-10-06 06:21:30 +08:00
|
|
|
directive. This causes a ScriptAlias overlap and breaks Zoneminder's
|
|
|
|
streaming abilities.
|
2013-09-29 04:18:45 +08:00
|
|
|
|
|
|
|
Reference: http://httpd.apache.org/docs/2.4/mod/mod_alias.html#order
|
|
|
|
Bug Report: https://bugzilla.redhat.com/show_bug.cgi?id=973067
|
|
|
|
|
|
|
|
WORKAROUND #1
|
2013-10-06 06:21:30 +08:00
|
|
|
If you are running zoneminder on a dedicated server then the simplest
|
|
|
|
solution may be to simply comment out the line in httpd.conf that reads:
|
2013-09-29 04:18:45 +08:00
|
|
|
|
|
|
|
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
|
|
|
|
|
|
|
|
WORKAROUND #2
|
2013-10-06 06:21:30 +08:00
|
|
|
If you need both the default cgi-bin folder & the zoneminder cgi-bin folder
|
|
|
|
then a solution might be to move the following line before the default
|
|
|
|
ScriptAlias directive in the httpd.conf file:
|
2013-09-16 05:33:09 +08:00
|
|
|
|
2013-09-29 04:18:45 +08:00
|
|
|
IncludeOptional conf.d/*.conf
|
2013-09-16 05:33:09 +08:00
|
|
|
|
2013-09-29 04:18:45 +08:00
|
|
|
8. Now start the web server:
|
|
|
|
|
|
|
|
sudo systemctl enable httpd.service
|
|
|
|
sudo systemctl start httpd.service
|
2013-09-16 05:33:09 +08:00
|
|
|
|
|
|
|
9. You should immediately visit http://localhost/zm and secure the system if
|
|
|
|
it is network facing. To do this:
|
|
|
|
|
|
|
|
a) click Options, then System.
|
|
|
|
b) check OPT_USE_AUTH.
|
|
|
|
c) set AUTH_HASH_SECRET to a random string.
|
|
|
|
d) click Save and refresh the main browser window.
|
2013-10-06 06:21:30 +08:00
|
|
|
e) You should be prompted to log in;
|
|
|
|
the default username/password is admin/admin.
|
2013-09-16 05:33:09 +08:00
|
|
|
f) Open Options again, choose the newly visible Users tab.
|
|
|
|
g) click the admin user and set a password.
|
2013-09-29 04:18:45 +08:00
|
|
|
h) enable OPT_CONTROL on the Ssytem tab to enable ptz camera control.
|
|
|
|
|
|
|
|
10. The zoneminder.service file fails at present but the zmpkg.pl script
|
|
|
|
can be run as root to start zoneminder.
|
|
|
|
|
|
|
|
sudo zmpkg.pl start
|
|
|
|
|
|
|
|
To start zoneminder automatically, create /etc/rc.d/rc.local and place the
|
|
|
|
following inside it:
|
|
|
|
#!/bin/sh
|
|
|
|
/usr/bin/zmpkg.pl start
|
2013-09-16 05:33:09 +08:00
|
|
|
|
2013-09-29 04:18:45 +08:00
|
|
|
The rc.local file must be made executable.
|
2013-09-16 05:33:09 +08:00
|
|
|
|
|
|
|
Upgrades
|
|
|
|
========
|
|
|
|
|
|
|
|
1. Update /etc/zm.conf. Check for any new settings and update the version
|
|
|
|
information. Comparing /etc/zm.conf and /etc/zm.conf.rpmnew should help to
|
|
|
|
do this.
|
|
|
|
|
2013-10-06 08:45:07 +08:00
|
|
|
2. Add the mysql ALTER permission to the zmuser account:
|
2013-09-16 05:33:09 +08:00
|
|
|
|
2013-10-06 08:41:28 +08:00
|
|
|
mysql -u root -p
|
|
|
|
grant alter on zm.* to
|
|
|
|
'zmuser'@localhost identified by 'zmpass';
|
|
|
|
|
|
|
|
Since this is an upgrade, the assumption is that the zmuser account already has
|
|
|
|
select, insert, update, and delete permission.
|
|
|
|
|
|
|
|
3. You will need to upgrade the ZoneMinder database as described in the
|
2013-10-06 08:45:07 +08:00
|
|
|
manual. Only if the previous step was succesful, may you run zmupdate like so:
|
2013-10-06 08:41:28 +08:00
|
|
|
|
|
|
|
sudo zmupdate.pl --version=<from version>
|
|
|
|
|
|
|
|
|
|
|
|
If unsure then run it this way:
|
|
|
|
|
|
|
|
sudo zmupdate.pl --user=root --pass=<mysql_root_pwd> --version=<from version>
|