Zoneminder nginx issues

Forum for questions and support relating to the 1.31.x releases only.
Locked
Waylorn
Posts: 4
Joined: Thu Jun 28, 2018 7:34 pm

Zoneminder nginx issues

Post by Waylorn »

I have a fresh install of zoneminder on linux mint 18.3 (ubuntu 16.04) I have a total of 20 grandstream IP cameras. I am sitting up the monitors with:
rtsp://10.10.10.11/0?tcp using ffmpeg. I had a previous install where this worked without issue. But on this install I get no video.

I used this install guide.
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

The one step I was unable to complete is editing nano /etc/default/fcgiwrap. This file does not exist in my install. So i am unable to change DAEMON_OPTS="-f -c 1"

Log sample.
2018-06-28 15:22:06.552617 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:21:56.509444 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:21:46.441145 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:21:36.595447 zma_m2 2656 INF RTF01: 234000 - Analysing at 9.90 fps zm_monitor.cpp 1296
2018-06-28 15:21:36.361704 zmc_m2 2652 INF RTF01: 234000 - Capturing at 9.90 fps zm_monitor.cpp 3125
2018-06-28 15:21:36.297666 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:21:26.237149 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:21:20.549697 zmc_m3 4090 INF RTF02: 198000 - Capturing at 9.90 fps zm_monitor.cpp 3125
2018-06-28 15:21:16.134319 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:21:06.074118 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:21:05.675006 zma_m3 4001 INF RTF02: 200000 - Analysing at 9.90 fps zm_monitor.cpp 1296
2018-06-28 15:20:56.997663 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:20:46.920929 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:20:36.877964 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:20:26.818211 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:20:16.748908 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:20:06.680794 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:19:56.645690 zmc_m2 2657 ERR Unable to open input rtsp://10.10.10.10/0?tcp due to: Operation now in progress zm_ffmpeg_camera.cpp 269
2018-06-28 15:19:55.882842 zma_m2 2656 INF RTF01: 233000 - Analysing at 10.00 fps zm_monitor.cpp 1296
2018-06-28 15:19:55.678645 zmc_m2 2652 INF RTF01: 233000 - Capturing at 9.90 fps zm_monitor.cpp 3125
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Zoneminder nginx issues

Post by bbunge »

There are some discovered issues with the NGINX install on Ubuntu 18.04 and now you mention the same issues on 16.04. fcgiwrap is located in another area. In fact it may be in two locations! Have not had time to sort out the changes.

As for your source string you do not need the ?tcp with this version. You still need to change the path in Options.

And you posted to the wrong forum area. Should be in 1.30.x

But, for a good working system switch to Mariadb and Apache on 16.04!
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Zoneminder nginx issues

Post by bbunge »

A bit more research reveals that the file nano /etc/default/fcgiwrap is supposed to be an override for the config file located in /etc/init.d/fcgiwrap. My quick test showed that adding DAEMON_OPTS="-f -c 1" to this file stops video streaming on working monitors. However, I am experiencing issues viewing montage with only the first monitor showing. Will keep at it...

bb
Waylorn
Posts: 4
Joined: Thu Jun 28, 2018 7:34 pm

Re: Zoneminder nginx issues

Post by Waylorn »

Ahhh. I did not know that there were known issues with nginx. I will reinstall using apache. Thanks for your help... I will be back with more questions after the reinstall. I had 20 camera's running and it was pegging out the cpu using 10 FPS using apache. It seems that the install is pretty easy. Getting it to work correctly is the issue.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Zoneminder nginx issues

Post by rockedge »

give Hiawatha a try....easy to configure for ZM... with a URLToolkit that works well with the API.....
https://www.hiawatha-webserver.org/

here is an example that works well with Hiawatha 10.8.1 PHP7.2.5, MariaDB and zoneminder 1.30.4 or 1.31.+

Code: Select all

# Hiawatha main configuration file
#
# GENERAL SETTINGS
#
ServerId = www-data
ConnectionsTotal = 1000
ConnectionsPerIP = 25
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log


# BINDING SETTINGS
# A binding is where a client can connect to.
#
Binding {
	Port = 80
#	Interface = 127.0.0.1
	MaxKeepAlive = 30
#	TimeForRequest = 3,20
        MaxRequestSize = 8192
}
#
Binding {
	Port = 443
#	Interface = ::1
	MaxKeepAlive = 30
	MaxRequestSize = 8192
#	TimeForRequest = 3,20
#	SSLcertFile = hiawatha.pem
	TLScertFile = hiawatha.pem
}


# BANNING SETTINGS
# Deny service to clients who misbehave.
#
#BanOnGarbage = 300
#BanOnMaxPerIP = 60
#BanOnMaxReqSize = 300
#KickOnBan = yes
#RebanDuringBan = yes
ChallengeClient = 200, httpheader, 60 

# COMMON GATEWAY INTERFACE (CGI) SETTINGS
# These settings can be used to run CGI applications.
#
CGIhandler = /usr/bin/perl:pl
CGIhandler = /usr/bin/php-cgi7.2:php
#CGIhandler = /usr/bin/python:py
#CGIhandler = /usr/bin/ruby:rb
#CGIhandler = /usr/bin/ssi-cgi:shtml
CGIextension = cgi
#
#FastCGIserver {
#	FastCGIid = PHP5
#	ConnectTo = /var/run/php5-fpm.sock
#	Extension = php
#}


# URL TOOLKIT
# This URL toolkit rule was made for the Banshee PHP framework, which
# can be downloaded from http://www.hiawatha-webserver.org/banshee
#
#UrlToolkit {
#	ToolkitID = banshee
#	RequestURI isfile Return
#	Match ^/(css|files|images|js|slimstat)($|/) Return
#	Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return
#	Match .*\?(.*) Rewrite /index.php?$1
#	Match .* Rewrite /index.php
#}

UrlToolkit {
  ToolkitID = api_rule
  Match ^/zm/api Rewrite  /zm/api/app/webroot/index.php$1
}

# DEFAULT WEBSITE
# It is wise to use your IP address as the hostname of the default website
# and give it a blank webpage. By doing so, automated webscanners won't find
# your possible vulnerable website.
#
Hostname = 127.0.0.1
WebsiteRoot = /var/www/hiawatha
StartFile = index.php
AccessLogfile = /var/log/hiawatha/access_log
ErrorLogfile = /var/log/hiawatha/error_log
#ErrorHandler = 404:/error.cgi
TimeForCGI = 3600
ShowIndex = yes
ExecuteCGI = yes
FollowSymlinks = yes
NoExtensionAs = cgi
EnablePathInfo = yes
UseLocalConfig = yes
Alias = /cgi-bin:/usr/lib/zoneminder/cgi-bin
Alias = /phpmyadmin:/usr/share/phpmyadmin
Alias = /zm:/usr/share/zoneminder/www
UseToolkit = api_rule 

# VIRTUAL HOSTS
# Use a VirtualHost section to declare the websites you want to host.
#
#VirtualHost {
#	Hostname = www.my-domain.com
#	WebsiteRoot = /var/www/my-domain/public
#	StartFile = index.php
#	AccessLogfile = /var/www/my-domain/log/access.log
#	ErrorLogfile = /var/www/my-domain/log/error.log
#	TimeForCGI = 5
#	UseFastCGI = PHP5
#	UseToolkit = banshee
#}
VirtualHost {
	Hostname = 192.168.0.*
	WebsiteRoot = /var/www/hiawatha
	StartFile = index.php
	AccessLogfile = /var/log/hiawatha/access_log
	ErrorLogfile = /var/log/hiawatha/error_log
	TimeForCGI = 3600
    ShowIndex = yes
    ExecuteCGI = yes
    FollowSymlinks = yes
#    UseFastCGI = PHP5
#    TriggerOnCGIstatus = yes    
    NoExtensionAs = cgi
    EnablePathInfo = yes    
    Alias = /cgi-bin:/usr/lib/zoneminder/cgi-bin
    Alias = /zm:/usr/share/zoneminder/www
    Alias = /phpmyadmin:/usr/share/phpmyadmin
    UseLocalConfig = yes
    UseToolkit = api_rule
}

VirtualHost {
	Hostname = your-zm-server.name
	WebsiteRoot = /var/www/hiawatha
	StartFile = index.php
	AccessLogfile = /var/log/hiawatha/access_log
	ErrorLogfile = /var/log/hiawatha/error_log
	TimeForCGI = 3600
        ShowIndex = yes
        ExecuteCGI = yes
        FollowSymlinks = yes
#    UseFastCGI = PHP5
#    TriggerOnCGIstatus = yes    
       NoExtensionAs = cgi
       EnablePathInfo = yes    
#    Alias = /cgi-bin:/usr/local/libexec/zoneminder/cgi-bin
      Alias = /cgi-bin:/usr/lib/zoneminder/cgi-bin
      Alias = /zm:/usr/share/zoneminder/www
      Alias = /phpmyadmin:/usr/share/phpmyadmin
      UseLocalConfig = yes
      UseToolkit = api_rule
}

# DIRECTORY SETTINGS
# You can specify some settings per directory.
#
#Directory {
#	Path = /home/baduser
#	ExecuteCGI = no
#	UploadSpeed = 10,2
#}
Locked