Zoneminder on FreeNAS

Status
Not open for further replies.

dunkyboy

Cadet
Joined
Jul 12, 2014
Messages
3
You were right. There wasn't a line to load the php5_module.

First, I followed your instructions to install php55-extensions, which was fine.

I added your suggested code, but it can't find the file.
Code:
root@Zonemaster:/ # service apache24 start
Performing sanity check on apache24 configuration:
httpd: Syntax error on line 153 of /usr/local/etc/apache24/httpd.conf: Cannot load libexec/apache24/libphp5.so into server: Cannot open "/usr/local/libexec/apache24/libphp5.so"
Starting apache24.
httpd: Syntax error on line 153 of /usr/local/etc/apache24/httpd.conf: Cannot load libexec/apache24/libphp5.so into server: Cannot open "/usr/local/libexec/apache24/libphp5.so"
/usr/local/etc/rc.d/apache24: WARNING: failed to start apache24


Here's the contents of the folder.
Code:
root@Zonemaster:/usr/local/libexec/apache24 # ls
httpd.exp                       mod_lbmethod_bybusyness.so
mod_access_compat.so            mod_lbmethod_byrequests.so
mod_actions.so                  mod_lbmethod_bytraffic.so
mod_alias.so                    mod_log_config.so
mod_allowmethods.so             mod_log_debug.so
mod_asis.so                     mod_logio.so
mod_auth_basic.so               mod_macro.so
mod_auth_digest.so              mod_mime.so
mod_auth_form.so                mod_mime_magic.so
mod_authn_anon.so               mod_negotiation.so
mod_authn_core.so               mod_proxy.so
mod_authn_dbd.so                mod_proxy_ajp.so
mod_authn_dbm.so                mod_proxy_balancer.so
mod_authn_file.so               mod_proxy_connect.so
mod_authn_socache.so            mod_proxy_express.so
mod_authz_core.so               mod_proxy_fcgi.so
mod_authz_dbd.so                mod_proxy_ftp.so
mod_authz_dbm.so                mod_proxy_http.so
mod_authz_groupfile.so          mod_proxy_scgi.so
mod_authz_host.so               mod_proxy_wstunnel.so
mod_authz_owner.so              mod_ratelimit.so
mod_authz_user.so               mod_remoteip.so
mod_autoindex.so                mod_reqtimeout.so
mod_buffer.so                   mod_request.so
mod_cache.so                    mod_rewrite.so
mod_cache_disk.so               mod_sed.so
mod_cache_socache.so            mod_session.so
mod_cgi.so                      mod_session_cookie.so
mod_cgid.so                     mod_session_crypto.so
mod_dav.so                      mod_session_dbd.so
mod_dav_fs.so                   mod_setenvif.so
mod_dbd.so                      mod_slotmem_shm.so
mod_deflate.so                  mod_socache_dbm.so
mod_dir.so                      mod_socache_memcache.so
mod_dumpio.so                   mod_socache_shmcb.so
mod_env.so                      mod_speling.so
mod_expires.so                  mod_ssl.so
mod_ext_filter.so               mod_status.so
mod_file_cache.so               mod_substitute.so
mod_filter.so                   mod_unique_id.so
mod_headers.so                  mod_unixd.so
mod_imagemap.so                 mod_userdir.so
mod_include.so                  mod_version.so
mod_info.so                     mod_vhost_alias.so


I'm just doing a search to find either libphp5.so or mod_libphp5.so anywhere on the jail.

Thanks so much for you help. This is my first install of a non-pbi. I tried the Zoneminder pbi returned "some error occured" when attempting to start the addon.

edit: after installing php5-extensions I also entered config and then reinstalled PHP.

edit2: i did not start with a port jail, but a normal plugin jail. So am starting over, i suspect this has caused many of my probs.
 
Last edited:

SinDeus

Explorer
Joined
Sep 3, 2013
Messages
65
Seems like the PHP module is now located at:
Code:
/usr/ports/www/mod_php5
(It used to be included in the main PHP port).
Try to install that one and restart your apache service.
 

SinDeus

Explorer
Joined
Sep 3, 2013
Messages
65
Is it that different from a 9.2 build? I won't upgrade my NAS to 9.3 before the official release, so I can't do that for you. Have you tried to run the guide anyhow? If you stumble on a step, we could try to figure out why.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Hi, could anybody update the guide for FreeNAS 9.3 beta?

Do not ask questions about beta software in the forums. The beta is meant for advanced users and only for testing the OS. Please consider this your warning.
 

dannyb78

Explorer
Joined
Aug 30, 2011
Messages
70
Hi SinDeus, thanks for your guide. Following your instructions I installed ZM into my 9.2.1.9 box.
It starts but I get alot of warning that I'm unable to manage. Would you (or anyone else) help me? thanks

here's the ZM console page
Code:
Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /usr/local/www/zoneminder/data/includes/database.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/zoneminder/data/includes/database.php:32) in /usr/local/www/zoneminder/data/includes/functions.php on line 89

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/zoneminder/data/includes/database.php:32) in /usr/local/www/zoneminder/data/includes/functions.php on line 90

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/zoneminder/data/includes/database.php:32) in /usr/local/www/zoneminder/data/includes/functions.php on line 91

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/zoneminder/data/includes/database.php:32) in /usr/local/www/zoneminder/data/includes/functions.php on line 92

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/zoneminder/data/includes/database.php:32) in /usr/local/www/zoneminder/data/includes/functions.php on line 93

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/zoneminder/data/skins/classic/views/console.php on line 186
Mon 1st Dec, 10:48pm
Carico Sistema: / Utilizzo Disco: -1%
ZoneMinder Console - Attivo - v1.25.0

0 Monitor
Opzioni / Log
Configurato per Bassa Banda

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/zoneminder/data/includes/functions.php on line 1427

Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/zoneminder/data/includes/functions.php on line 1427

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/zoneminder/data/includes/functions.php on line 1427

Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/zoneminder/data/includes/functions.php on line 1427

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/zoneminder/data/includes/functions.php on line 1427

Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/zoneminder/data/includes/functions.php on line 1427

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/zoneminder/data/includes/functions.php on line 1427

Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/zoneminder/data/includes/functions.php on line 1427
 

9C1 Newbee

Patron
Joined
Oct 9, 2012
Messages
485
I think you have to go in and set the timezone by editing a config file. Not quite sure how to do this, but that is the direction I would take to take care of the "timezone" errors.
 

SinDeus

Explorer
Joined
Sep 3, 2013
Messages
65
Hello!

As the warning messages state (as well as 9C1 above), you first have to set your timezone in the PHP configuration file. Add this line in your /usr/local/etc/php.ini:
Code:
date.timezone = 'Europe/Paris'


If the line is already there, but starts with a ';', be sure to remove it. Also, adapt the timezone to your needs (see http://php.net/manual/en/timezones.php).

Then, to get rid of the deprecated warnings, you can prevent them from being displayed by editing the file /usr/local/www/zoneminder/data/index.php. Simply change
Code:
error_reporting( E_ALL );

to
Code:
error_reporting( 0 );
 

Luis

Cadet
Joined
Dec 8, 2014
Messages
2
Hello,
I installed following the tutorial, but something went wrong.
Can somebody help me?


Code:
root@cctvserver:/ # service zoneminder start
Starting zoneminder.
Bareword "ZM_PATH_LOGS" not allowed while "strict subs" in use at /usr/local/lib/perl5/site_perl/ZoneMinder/Logger.pm line 153.
BEGIN not safe after errors--compilation aborted at /usr/local/lib/perl5/site_perl/ZoneMinder/Logger.pm line 168.
Compilation failed in require at /usr/local/lib/perl5/site_perl/ZoneMinder.pm line 34.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/ZoneMinder.pm line 34.
Compilation failed in require at /usr/local/bin/zmpkg.pl line 37.
BEGIN failed--compilation aborted at /usr/local/bin/zmpkg.pl line 37.
/usr/local/etc/rc.d/zoneminder: WARNING: failed to start zoneminder
root@cctvserver:/ #
 
Last edited:

stillka

Explorer
Joined
Nov 15, 2014
Messages
55
Hi, could somebody update the Zoneminder install guide for released FreeNAS 9.3?

I have installed is successfully and it works but I have issue with not working video playback/preview.

Here are logged errors after I enter camera monitor menu:
2014-11-27 19:06:08.982567 web_php 32767 ERR socket_sendto( /tmp/zm/zms-044853s.sock ) failed: No such file or directory /usr/local/www/zoneminder/data/includes/functions.php 2322

So it looks like problem with SOCKET but I selected socket support during compilation of /usr/ports/lang/php55-extensions.

Could somebody check this and test Zoneminder installation on FreeNAS 9.3 STABLE?

Thank you!
 
Last edited:

babaz83

Dabbler
Joined
Nov 10, 2014
Messages
19
Hello everybody,
excuse me, anybody did a working pbi plugin?
Thank you.
 

petr

Contributor
Joined
Jun 13, 2013
Messages
142
Hello!

I think it's working for me!

Changes I had to do compared to the tutorial:

Code:
# in the beginning
cd /usr/ports/ports-mgmt/pkg/ && make install clean 

# I had to install mod_php55 instead of mod_php5
cd /usr/ports/www/mod_php55
make install clean

# MySQL syntax was slightly different
grant all privileges on zm.* to  'zmuser'@'localhost' identified by 'zmpass';

# I had to enable CGI module in php.ini (was commented out)
LoadModule cgi_module libexec/apache24/mod_cgi.so


I've also removed deprecation warnings as there were loads due to zoneminder using older version of the mysql interface. So far so good - will try to add all of the cameras and will report back!
 

petr

Contributor
Joined
Jun 13, 2013
Messages
142
One more tweak - I had to play around with permissions in the zm folder and create some extra ones, for example, zone editor did not work until I created folder "images" and added right permissions.

Another tweak I had to do was to override the auto-detection of browser streaming capability, set those all to yes - (you can do it for each bandwidth setting tab)
 

stillka

Explorer
Joined
Nov 15, 2014
Messages
55
One more tweak - I had to play around with permissions in the zm folder and create some extra ones, for example, zone editor did not work until I created folder "images" and added right permissions.

Another tweak I had to do was to override the auto-detection of browser streaming capability, set those all to yes - (you can do it for each bandwidth setting tab)

Hi,

could you specify exactly what directories is necessary to create with what rights and where?
+ could you paste here your entire php.ini file? I have checked mine and it's quite empty, maybe it's corrupted:
root@ZoneMinder:/usr/local/etc # cat php.ini
date.timezone = 'Europe/Paris'

Thank you.
 

petr

Contributor
Joined
Jun 13, 2013
Messages
142
Hi,

could you specify exactly what directories is necessary to create with what rights and where?
+ could you paste here your entire php.ini file? I have checked mine and it's quite empty, maybe it's corrupted:
root@ZoneMinder:/usr/local/etc # cat php.ini
date.timezone = 'Europe/Paris'

Thank you.

I've actually copied the php.ini-production into php.ini (which I did not have on my system initially). I then added this line:

Code:
error_reporting = E_ALL ^ E_DEPRECATED


This effectively removed the deprecation warnings - I should have checked the later posts, I had to do my own digging :D.

In terms of directories, I've created images and events directory (the second one I am not 100% sure about) and gave them www:www permissions. That cured some of the rendering.

The biggest change is to force ZM to assume that the browser is capable of image streaming - the auto-detect may not work in 1.25 for modern browsers (it works fine on 1.26 on my another machine..).

Anyway - very happy to get it to work!

Just a side note - I am not on 9.3 yet, running latest of the 9.2 branch and I've started with fresh 9.2 jail as suggested.
 

stillka

Explorer
Joined
Nov 15, 2014
Messages
55
I've actually copied the php.ini-production into php.ini (which I did not have on my system initially). I then added this line:

Code:
error_reporting = E_ALL ^ E_DEPRECATED


This effectively removed the deprecation warnings - I should have checked the later posts, I had to do my own digging :D.

In terms of directories, I've created images and events directory (the second one I am not 100% sure about) and gave them www:www permissions. That cured some of the rendering.

The biggest change is to force ZM to assume that the browser is capable of image streaming - the auto-detect may not work in 1.25 for modern browsers (it works fine on 1.26 on my another machine..).

Anyway - very happy to get it to work!

Just a side note - I am not on 9.3 yet, running latest of the 9.2 branch and I've started with fresh 9.2 jail as suggested.


Hello,
finally I have solved my problem in ZoneMinder and FreeNAS 9.3 with not working SOCKETs by enabling cgi module:

root@ZoneMinder:/usr/local/etc/apache24 # grep mod_cgi httpd.conf
LoadModule cgi_module libexec/apache24/mod_cgi.so

That's all.
 

petr

Contributor
Joined
Jun 13, 2013
Messages
142
root@ZoneMinder:/usr/local/etc/apache24 # grep mod_cgi httpd.conf
LoadModule cgi_module libexec/apache24/mod_cgi.so

Yes, I had the same problem - CGI was there, but not active. That's what I mention in my previous posts, that cgi had to be un-commented.

On a related note - I was amazed on the amount of dialogs I had to click-through, therefore I was actually quite surprised to find it all working after all that compilation!

One learns to appreciate how polished apt-get package setup process is on recent distros!
 

stillka

Explorer
Joined
Nov 15, 2014
Messages
55
Yes, I had the same problem - CGI was there, but not active. That's what I mention in my previous posts, that cgi had to be un-commented.

On a related note - I was amazed on the amount of dialogs I had to click-through, therefore I was actually quite surprised to find it all working after all that compilation!

One learns to appreciate how polished apt-get package setup process is on recent distros!

Hi, in my case (version 9.3) I have this directories there by default:
root@ZoneMinder:/usr/local/www/zoneminder/data # ll
total 42
...
drwxr-xr-x 3 www www 5 Dec 8 16:25 events/
drwxr-xr-x 2 www www 2 Nov 29 08:42 images/
...

About that mod-cgi issue, you mentioned that module is in php.ini but it's in httpd.conf. Anyway, thank you for your tips, ZM is running well now on 9.3. :smile:
 

petr

Contributor
Joined
Jun 13, 2013
Messages
142
I would like to add a big, fat warning here - really do a LOT of testing before finalising the setup. The thing is, the

Code:
allow.sysvipc=1


can have quite wide security/stability implications. My system is now locking up after a few hours of use, and the only change is really the zm jail with the sysipc enable (I've removed any tunables earlier). To clarify, locking-up is not the best term. The web service stops working, I cannot SSH in anymore but other services like file sharing still work. I was also able to get up a physical machine but it does not respond to reboot commands and the apache process (within jail) cannot be killed.. which I consider concerning at least!

I do not think it was explicitly said in this thread but I recommend utmost caution when giving jails too much privileges.. The main worrying part for me is that it made the whole system lock up / unstable...

Sources:
http://serverfault.com/questions/15...ions-of-using-allow-sysvipc-in-a-freebsd-jail
https://www.freebsd.org/doc/en/books/arch-handbook/jail-restrictions.html
 

stillka

Explorer
Joined
Nov 15, 2014
Messages
55
The main worrying part for me is that it made the whole system lock up / unstable...

Hi, on my configuration (9.3 Stable) I have so far no problem with any instability.
 
Status
Not open for further replies.
Top