Fedora

From ZoneMinder Wiki
Revision as of 22:30, 30 September 2012 by Tgutwin (talk | contribs) (Added Fedora 18 Alpha changes)
Jump to navigationJump to search

The Fedora Project is a Red Hat sponsored, community-supported open source project. Its stated goal is to promote the rapid progress of free (as in freedom) and open source software and content, and its rapid innovation is possible using open processes and public forums.

The project is led by the Fedora Project Board, which is comprised of community leaders and Red Hat members, and this group steers the direction of the project and of Fedora Core, the Linux distribution it develops. Red Hat employees work with the code alongside community members, and many Fedora Project innovations make their way into new releases of Red Hat Enterprise Linux.

ZoneMinder is developed on the Fedora distribution and no special actions are usually required for installation.

Fedora 18 (alpha)

Do all the following as sudo (or root)
install packages
yum install mysql mysql-server zoneminder

disable selinux
vi /etc/selinux/config

  • change the word 'enforcing' to 'disabled'

REBOOT

setup mysql:
systemctl start mysqld.service
mysql_secure_installation # enable root password
mysql -u root -p < /usr/share/zoneminder/db/zm_create.sql
mysql -u root -p
grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
use zm;
quit

setup apache web server:
vi /etc/httpd/conf.d/zoneminder.conf

  • in the section - <Directory "/usr/share/zoneminder/www">
    • remove the line "Deny from all # DELETE THIS LINE"
    • remove the '-Indexes' on the Options line on Line 17 )I don't think the '-' is supposed to be there
    • Comment out the Order and Allow lines and insert the new syntax 'Require all granted' as a new line
  • I also got a ScriptAlias error for the cgi-bin/zm alias so I commented the cgi-bin scriptAlias in the /etc/httpd/conf/httpd.conf


systemctl start httpd.service

start zoneminder:
systemctl start zoneminder.service

Fedora 17

install packages
yum install mysql mysql-server zoneminder

setup mysql:
systemctl start mysqld.service
mysql_secure_installation # enable root password
mysql -u root -p < /usr/share/zoneminder/db/zm_create.sql
mysql -u root -p
grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
use zm;
quit

setup apache web server:
vi /etc/httpd/conf.d/zoneminder.conf # remove the line "Deny from all # DELETE THIS LINE"
systemctl start httpd.service

start zoneminder:
systemctl start zoneminder.service

Fedora 14

install packages:
yum install mysql mysql-server zoneminder

setup mysql:
/etc/init.d/mysqld start
mysql_secure_installation # enable root password
mysql -u root -p < /usr/share/zoneminder/db/zm_create.sql
mysql -u root -p
grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
use zm;
quit

setup apache web server:
vi /etc/httpd/conf.d/zoneminder.conf # remove the line "Deny from all # DELETE THIS LINE"
/etc/init.d/httpd start

start zoneminder
/etc/init.d/zoneminder start

Fedora 11, 12 and 13

The Easy Way Adapted from a forum post by "hiredguntech" or just search the forum for "flowers for candy"

Step-by-step installation of ZM v1.24.2 on Fedora-12.

(1) load fc12 using the netinstall ISO (the CD wants to use dhcp and doesn't work well with an assigned fixed IP) - turn off 'office' and turn on 'server' and 'development'. Besure to include a large /var partition through custom partitioning and use localhost instead of what it suggests (domain.localhost ?). Also, if you're using a capture card install it (them) in the system before starting the netinstall CD. Save these steps as a .txt file so the code can be cut and paste into the terminal with ease.

[2] Remove evolution from task bar (right click... (not a requirement)).

[3] Set screensaver to NOT require password and set it to 20 minutes or more (menu-system::preferences::screensaver).

(4) Disable SELinux. (menu-system::Admin::SELinux Mgmnt; change system default enforcing mode to disabled).

[5] Enable sudo for yourself. From a terminal (menu-Application::System Tools::Terminal), Code:

su

(enter root password)

echo 'YourUserName ALL=(ALL) ALL' >> /etc/sudoers (put YOUR user name from FC12 installation in place of YourUserName)

(6) Set up the RPM Fusion Repository (in open terminal).

Code:

rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm

rpm -ivh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

exit

exit (closes terminal window)

(7) Install the pre-requisites, (menu-System::Administration::Add/Remove Software) type in the search field the following package names and select each of the closest match (there will be 'other' packages related or similar named - look for the right one, and check-it.)

mysql-server

mysql-devel

pcre-devel

ffmpeg

ffmpeg-devel

Hit the 'Apply' button, accept any added packages, type root password, and let this stuff load.

[8] Install any updates that are available, its the yellow icon up by the time.

(9) Enable the services: web and db. (menu-System::Administration::Services) and find the following:

httpd

mysqld

for each of them hit the 'enable button' so you can start them later.

(10) Reboot. This allows all the services to start and settle in.

(11) Now add Zoneminder (menu-System::Administration::Add/Remove Software) Type Zoneminder in the search field select it and apply.

[13] Note: To edit as root: open a terminal (menu-Application::System Tools::Terminal), su to root, type 'gedit <path/filename>'. Now you have sufficient permissions to edit & save as root.

(14) Edit as root /etc/httpd/conf.d/zoneminder.conf to remove the 'Deny from All' line. It even says 'DELETE THIS LINE', so it should be easy to find. Save it.

(15) As root, [or with sudo] build the zm database (menu-Application::System Tools::Terminal).

Code:

su

(enter root password)

mysql mysql < /usr/share/zoneminder/db/zm_create.sql

mysqladmin reload

mysql mysql

grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';

\q

exit

exit


(16) Enable zoneminder. (menu-System::Administration::Services) and find zoneminder. Enable it. You can start the service hear also, Or in a terminal:

Code:

service zoneminder start

[18] Last thing - edit the SECOND entry of short_open_tag down at line 229. Again as root (menu-Application::System Tools::Terminal), gedit /etc/php.ini

Change short_open_tag from 'off' to 'on'

[19] reboot. open browser, type 'localhost/zm'

[20] It may be necessary to change the ffmpeg path in options::images to get ffmpeg to make videos. Generally removing the /local from the existing path will fix this issue


Or (the original wiki walk through)

You should be able to just do "yum install zoneminder", create the zm database, find the zm_create.sql file (rpm -ql zoneminder) and import it to mysql, then start zoneminder. Plus allow web access. Edit /etc/httpd/conf.d/zoneminder.conf and comment out (#) or delete this line :-

Deny from all # DELETE THIS LINE

Restart/reload apache

sudo service httpd restart

This didn't work for me due to 2 problems. First was php.ini section short_open_tag = Off, set to on

short_open_tag = On

Restart/reload apache

sudo service httpd restart

The other problem was zm_create.sql had duplicate indexes reported using phpMyAdmin. Removed all "INSERT INTO MonitorPresets" and "INSERT INTO MonitorPresets" in zm_create.sql and that imported cleanly. Alternatively just import from the command line mysql -u zmuser -p < zm_create.sql

http://www.zoneminder.com/forums/viewtopic.php?p=50242


Manual Install Version 1.24.2 with ffmpeg enabled

Version 1.23.3 has always compiled ok on Fedora 9/10/11 but I had problems with version 1.24.2.

Problems with compiling fixed by adding #include <cstdio> to all .cpp files in src directory and removing ccache package (yum remove ccache)

http://www.zoneminder.com/forums/viewtopic.php?p=55152

http://www.zoneminder.com/forums/viewtopic.php?t=12515&sid=0da85eb2fc78917d7a78cf788603a320

If using ffmpeg and ffmpeg-devel packages you may see problem compiling with libavutil.a . I could not get ffmpeg to compile so downloaded the Fedora source package and compiled it manually.

yumdownloader --source ffmpeg

sudo rpm -Uvh ffmpeg-0.5-5.20091026svn.fc12.src.rpm

Needed the following packages

sudo yum install dirac-devel faad2-devel gsm-devel imlib2-devel lame-devel libdc1394-devel libtheora-devel libvdpau-devel openjpeg-devel \
schroedinger-devel speex-devel texi2html x264-devel xvidcore-devel yasm

See http://fozzolog.fozzilinymoo.org/tech/2009/11/recompiling-ffmpeg-for-fedora-12-to-add-faac-support.html (don't need to add faac support, just follow procedure)

My rpmbuild failed so from the BUILD/ffmpeg-20091026

make
sudo make install
sudo make install-libs

and configured ZoneMinder to use /usr/local for FFMPEG

./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost \
ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass --with-extralibs="-L/usr -L/usr/lib/mysql" ZM_SSL_LIB=openssl --with-ffmpeg=/usr/local

Fedora 8

  • Have packages for Apache and MySQL installed on the system.
  • Install the zoneminder RPM package on the system
Fedora Information for package zoneminder
* http://koji.fedoraproject.org/koji/packageinfo?packageID=4691
  • Configure zoneminder
  • Make sure Apache and MySQL services are running
  • Edit the zoneminder.conf apache configuration file to allow web connections
 vi /etc/httpd/conf.d/zoneminder.conf
  • Build the MySQL database table for zoneminder
 mysql -p -u root mysql < /usr/share/zoneminder/db/zm_create.sql > mysqladmin -p -u root reload

The Fedora RPM creates /var/log/zoneminder, but the database scripts point logs to /tmp, rather than the new directory.

  • Click Options, Paths tab, and change
 ZM_PATH_LOGS = /var/log/zoneminder
  • Click Options, Debug tab, and change
 ZM_EXTRA_DEBUG_LOG = /var/log/zoneminder/zm_debug.log+
  • Install ffmpeg on Fedora.

Due to licensing the ffmpeg package is absent from Fedora. It can be added from Livna.

 wget http://rpm.livna.org/livna-release-8.rpm
 rpm -ih livna-release-8.rpm
 yum install ffmpeg
 yum install ffmpeg-devel

Which provides the following: ffmpeg-libs-0.4.9-0.41.20071011.lvn8, ffmpeg-0.4.9-0.41.20071011.lvn8, ffmpeg-devel-0.4.9-0.41.20071011.lvn8

  • Test ffmpeg
 ffmpeg -f image2 -i %03d-capture.jpg /tmp/movie.mpg

Fedora 7

Fedora Core 6

Fedora Core 4

Set web user and group correctly and set the log dir to a writeable location. With FC4 there are three things that must be done to get ZM running,:

  1. is in the /etc/ld.so.conf.d/ dir created a file with 775 perm called zm.conf and add the line '/usr/local/lib' to it and type 'ldconfig' once it is added, also with a fresh install of FC4 make sure SE linux is disabled if you are not using it. Check your log path in options under the paths tab. This will tell you were the log are going to be put.
  2. Second make sure the path exists.
  3. Third create the log files if they do not exist and make sure that they have the correct permissions. If zm can not open and write the log files, it will not start.