Zoneminder

Установка
make config-recursive install clean -C /usr/ports/multimedia/zoneminder

Поскольку сказал clean, то надо было снова получить make extract нет. тогда получится zm_create.sql.in, надо говорить make configure

Базы нет еще mysql -e "use zm; show tables;"

mysql source /usr/ports/multimedia/zoneminder/work/ZoneMinder-1.24.4/db/zm_create.sql; grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass'; flush privileges; echo 'zoneminder_enable="YES"' >> /etc/rc.conf /usr/local/etc/rc.d/zoneminder start

Нету настроек. Ставит sudo

Origin
This port project started its life based on quadra's original port for version 1.19.2. Brooktree (bktr) video input support code written by quadra is virtually unchanged in this port other than some function argument changes to match the latest ZoneMinder version (1.22.3). Although this code compiles, I have not tested its functionality. Currently, I only have two Axis 206 network cameras, which work fine, but I have not tested the set up with any other camera configurations.

I have tested this port on FreeBSD 5.5 (i386) as well as FreeBSD 6.2 (i386) without any problems.

Preparation

 * Download the port (zoneminder-freebsd-port-1.22.3p[version].tgz)
 * Become root and 'cd' to /usr/ports/multimedia/
 * Extract the port files. You know how to do 'tar zxf' right?

You should now have /usr/ports/multimedia/zoneminder/

Now, go to the directory and look at files/patch-SharedMem.pm

What this patch does is to hard-wire native size to 4 (32-bits). On FreeBSD, Perl is configured with -Duse64bitint by default and the method that is used by SharedMem.pm to determine architectural bit width incorrectly considers an i386 machine as 64-bit capable. I'm not a perl expert -- in fact, I hate perl -- and I really have no idea how to properly determine pointer size in Perl, so this patch exists. Obviously, if you are running FreeBSD-AMD64 (or Alpha or something, although I have no idea if this software would work on that architecture), you will want to get rid of this patch file. Just delete it _before_ you make.

And if you're bored, feel free to go through all the patch files just marvelling at all the trouble I had to go through ^_^;

Now that we've gotten that little quirk out of the way, we'll move on to Makefile. Open Makefile using your favorite text editor and modify the following items if they're not suitable for you.

already have apache installed, you should point this to the same place where apache thinks is the web base. Default is /usr/local/www, as can be seen in the Makefile. mysql server on a different machine, you'll want to update this line, but I'm not sure if you can avoid installing mysql on this machine. Disk space is cheap, so I don't think it's that big a deal having mysql just sitting there, as long as it's not started. I'm pretty sure ZoneMinder won't mind sharing a base database with other applications, but it certainly doesn't hurt to let it have its own database space, so this defaults to "zm" database.
 * WWWDIR : This is where your web server will serve from. If you
 * ZM_DB_HOST : This is where mysql server runs. If you're running
 * ZM_DB_NAME : This is the database name that ZoneMinder will use.
 * ZM_DB_USER and ZM_DB_PASS are username and password for the

We're almost ready to "make," but first, consider the following points and just imagine how things can break based on your situation.

1.xx.xx of apache. On the other hand, if you already have apache 2.xx.xx installed, I do not know what will happen. My guess is that things will work just fine since php5 port will see apache2 installation and skip apache1 installation. build will probably fail. Even if it doesn't fail, you probably do not want multiple versions of mysql installed on your machine. You can either edit the dependency in the Makefile to point to your version of mysql, or get rid of the dependency statement for mysql. Getting rid of it is not as nice, but I'm sure you're able to keep the dependencies in mind when messing around with ports in the future.
 * If you do not have apache installed, this port will install version
 * If you have mysql version other than 5.0.xx installed, this port

the Makefile to point to php4-extensions instead of php5-extensions. I know for a fact that both versions work fine with ZoneMinder. and X10::ActiveHome because I do not have PTZ camera and my X10 is handled by another dedicated machine. If you want this, you'll want to tinker with the port some more. You can also manually install those ports (if they exist) before doing make. I imagine ZoneMinder's configure script will pick them up.
 * If you have PHP4 installed, you should modify the dependencies in
 * I have not set up dependencies for perl modules Device::SerialPort

That's about it. Let's make!

Making
There's really nothing special about making. Just 'make' will do. However, during the dependency builds, make sure PHP install includes the apache module. If you already have PHP installed without apache module, you can always tinker with the Makefile in /usr/ports/lang/php5/ and do 'make deinstall' followed by 'make reinstall' to reinstall the port with additional modules.

If the build fails, take a deep breath, yell at your computer for a moment, and try to figure out if you messed up anything while changing the Makefile in one of the above steps. If you do not believe you've done anything wrong and still can't figure out why the build fails, there's always the forum....

If it builds fine, feel free to 'make install'

However, do NOT 'make clean' yet!

Seeding the database
If this is the first time installing ZoneMinder, you'll need to seed the mysql database with ZoneMinder's configuration information. To do this, follow these steps as a root user.

First, if this is the first time mysql was installed, you'll want to consider where you want the database files to reside. Default is /var/db/mysql/ but you may have set up a dedicated partition for it. If you want to change it, just put the following line in /etc/rc.conf


 * mysql_dbdir="/somewhere/else/you/want"

Obviously, you'll want this line in there, too:


 * mysql_enable="YES"

Now, start the sucker up.

shell> /usr/local/etc/rc.d/mysql-server start

Assuming it started fine, give it a few seconds and then continue. Note that you should be at /usr/ports/multimedia/zoneminder/ for the following steps.

shell> mysql -h localhost -u root -p

This will ask for a password. Just press enter to go with an empty password. You should now be in mysql command line interface.

mysql> source work/ZoneMinder-1.22.3/db/zm_create.sql

Above runs bunch of SQL commands from the file, seeding the database.

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

Above sets up permissions. Note that if you changed database name, user name, or password in the Makefile, you'll need to modify above command accordingly.

Post-Installation Quirks
PHP5 installation does not necessarily set up the apache configuration file properly. You will want to make sure that following lines are in apache configuration file, /usr/local/etc/apache/httpd.conf


 * AddType application/x-httpd-php .php
 * AddType application/x-httpd-php-source .phps

While you're at it, you might also want to check that following line is in the configuration file.


 * LoadModule php5_module libexec/apache/libphp5.so

Automatic Execution at Boot
Obviously, if this is to be used as a security device, you'll want it to start automatically on a reboot. Again obviously, you need to have both apache and mysql start up as well, unless of course, you're running mysql on a remote machine. If you are, I'm sure you're an expert at this stuff already.

Add following lines into /etc/rc.conf, if not already present. Order is not important.


 * apache_enable="YES"
 * mysql_enable="YES"
 * zm_enable="YES"

Just for your information, I had to put 'sleep 10' in ZoneMinder startup script because mysql port does not become available immediately after mysql startup script finishes.

More Quirks
Depending on the number of cameras and their resolution settings, you may need a lot more shared memory than provided by a default kernel. If you've never built a custom kernel before, umm, time for you to read the FreeBSD Handbook. It can be found at /usr/share/doc/handbook/index.html or at http://freebsd.org/

For the rest of you, just add a reasonable-looking version of the following lines into your kernel configuration file and go though the buildkernel, installkernel process.


 * options SHMMAXPGS=65536
 * options SHMMNI=384
 * options SHMSEG=256

I think above gives maximum of 256MB of shared memory. SHMMNI statement probably isn't required since ZoneMinder probably creates one big instance per camera instead of many little instances. I'm not sure about the last one. Whatever the case, above works for me with two Axis 206 cameras.

Adding the following line into /etc/sysctl.conf may speed up the shared memory accesses, so even though it's not required, it's probably a good idea.


 * kern.ipc.shm_use_phys=1

That's all folks! ===>  Compressing manual pages for zoneminder-1.24.4_12 ===>  Registering installation for zoneminder-1.24.4_12 ===> SECURITY REPORT: This port has installed the following binaries which execute with increased privileges. /usr/local/bin/zmfix

This port has installed the following files which may act as network servers and may therefore pose a remote security risk to the system. /usr/local/www/zoneminder/cgi-bin/zms /usr/local/bin/zmu /usr/local/bin/zmstreamer /usr/local/bin/zma /usr/local/bin/zmc /usr/local/bin/zmf /usr/local/www/zoneminder/cgi-bin/nph-zms

This port has installed the following startup scripts which may cause these network services to be started at boot time. /usr/local/etc/rc.d/zoneminder

If there are vulnerabilities in the

 ===> Cleaning for p5-DBI-1.616 ===> Cleaning for p5-DBD-mysql55-4.019 ===> Cleaning for p5-Date-Manip-6.24 ===> Cleaning for p5-libwww-6.02_1 ===> Cleaning for p5-Archive-Zip-1.30_1 ===> Cleaning for p5-Archive-Tar-1.76 ===> Cleaning for p5-MIME-Lite-3.02.7 ===> Cleaning for p5-MIME-Tools-5.502,2 ===> Cleaning for netpbm-10.35.81 ===> Cleaning for sudo-1.8.1_5 ===> Cleaning for p5-Storable-2.25 ===> Cleaning for p5-YAML-Syck-1.17 ===> Cleaning for p5-Authen-NTLM-1.08_1 ===> Cleaning for p5-Encode-Locale-1.02 ===> Cleaning for p5-File-Listing-6.02 ===> Cleaning for p5-HTML-Parser-3.68 ===> Cleaning for p5-HTTP-Cookies-6.00 ===> Cleaning for p5-HTTP-Daemon-6.00 ===> Cleaning for p5-HTTP-Date-6.00 ===> Cleaning for p5-HTTP-Message-6.02 ===> Cleaning for p5-HTTP-Negotiate-6.00 ===> Cleaning for p5-LWP-MediaTypes-6.01 ===> Cleaning for p5-Net-HTTP-6.01 ===> Cleaning for p5-URI-1.58 ===> Cleaning for p5-WWW-RobotRules-6.01 ===> Cleaning for p5-IO-String-1.08 ===> Cleaning for p5-Email-Date-Format-1.002 ===> Cleaning for p5-MIME-Types-1.31 ===> Cleaning for p5-Mail-Tools-2.08 ===> Cleaning for p5-Convert-BinHex-1.119 ===> Cleaning for p5-IO-stringy-2.110 ===> Cleaning for p5-Digest-HMAC-1.03 ===> Cleaning for p5-HTML-Tagset-3.20 ===> Cleaning for p5-Compress-Raw-Zlib-2.037 ===> Cleaning for p5-IO-Compress-2.037 ===> Cleaning for p5-IO-Socket-SSL-1.44 ===> Cleaning for p5-TimeDate-1.20,1 ===> Cleaning for p5-Compress-Raw-Bzip2-2.037 ===> Cleaning for p5-Net-SSLeay-1.36 ===> Cleaning for zoneminder-1.24.4_12 

http://forum.lissyara.su/viewtopic.php?f=3&t=14226&start=225 http://www.lissyara.su/articles/freebsd/programms/zoneminder_2/ http://www.lissyara.su/articles/freebsd/programms/zoneminder/ http://www.ab-log.ru/page.php?Cat=11&ID=12&q=ebus