Page 1 of 1

Another Socket error

Posted: Tue Jan 17, 2017 3:05 am
by epicfatigue
Hey Guys,


So i am having a little issue.
I am not getting any streaming from the web GUI.

I had a look at
https://zoneminder.readthedocs.io/en/st ... -streaming

I am running on FREENAS 9.10
And i am using NGINX not Apache like the GitHub suggested .

Since i am running NGINX the guide doesnt really apply.
Should i switch to Apache?

Any Pointers or Direction would be awesome thanks guys

Code: Select all

user www;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 1024; ## Default: 1024
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local]
"$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
server_tokens off;
gzip on;
gzip_comp_level 4;
gzip_min_length 1100;
Stopping mysql.
Waiting for PIDS: 1427.
Starting mysql.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
gzip_buffers 64 8k;
gzip_http_version 1.1;
gzip_proxied any;
gzip_types text/plain application/xml application/x-javascript
text/css;
server {
root /usr/local/www/zoneminder;
try_files $uri $uri/ /index.php$is_args$args;
index index.php;
location = /cgi-bin/nph-zms {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php-fpm.sock;
}
location /api {
rewrite ^/api/(.+)$ /api/index.php?p=$1 last;
}
}
}

Re: Another Socket error

Posted: Fri Jan 20, 2017 2:42 am
by epicfatigue
Any Ideas Guys ?

I see the socket being created in the directory it is looking for? however it can not seem to bind to it....

Re: Another Socket error

Posted: Fri Jan 20, 2017 3:17 am
by bbunge
Do not know of any folks running Zoneminder on a NAS package. You might have better luck getting an answer if you ran a regular Linux distro. Sorry...

Re: Another Socket error

Posted: Fri Jan 20, 2017 4:33 am
by rockedge
the /cgi-bin needs to be configured in NGINX similar to setting up ZM on a Hiawatha server. alias the cgi-bin to match your path PATH_ZMS and that the cgi-bin is reachable. In Hiawatha there is a config to specify what to do with files with no extension so they run as CGI which is the case with ZMS and NPH-ZMS. Simply put you need to tell NGINX where the streaming components are in the cgi-bin and have the correct permissions.
I think..........

Re: Another Socket error

Posted: Mon Jan 23, 2017 11:07 am
by epicfatigue
Thanks for the Help Guys,

Sadily none of those worked.

However i did manage to solve it.
It was a NGINX config error as suggested.


My Server block needed to be configured this way.

server {
root /usr/local/www/zoneminder;
try_files $uri $uri/ /index.php$is_args$args;
index index.php;

location = /cgi-bin/nph-zms {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock;

}