RESOLVED! Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Forum for questions and support relating to the 1.29.x releases only.
Post Reply
dingbatca
Posts: 13
Joined: Tue Feb 09, 2016 11:36 pm

RESOLVED! Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by dingbatca » Tue Feb 09, 2016 11:52 pm

Updated for those who follow. Here is the fix:

Two tweaks must be applied.
1) (Web interface) Options, paths, and update PATH_ZMS from "/cgi-bin/nph-zms" to "/zoneminder/cgi-bin/nph-zms"

Code: Select all

==> error.log <==
[Tue Feb 09 15:33:23.463262 2016] [cgi:error] [pid 1278] [client 192.168.0.222:62826] script not found or unable to stat: /usr/lib/cgi-bin/nph-zms, referer: http://192.168.0.13/zm/index.php?view=watch&mid=1
2) Must fix the pathing in apache to match the above configuration

Code: Select all

edit /etc/apache2/conf-available/zoneminder.conf
#ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
ScriptAlias /zoneminder/cgi-bin "/usr/lib/zoneminder/cgi-bin"

service apache2 restart
service zoneminder restart
My original first post below.

Been ripping my hair out over this. Clean install of Ubuntu 14.04 LTS, OpenSSH is the only packages selected, then follow the install process on the Wiki:
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

First bug I run into:

Code: Select all

==> error.log <==
[Tue Feb 09 15:33:23.463262 2016] [cgi:error] [pid 1278] [client 192.168.0.222:62826] script not found or unable to stat: /usr/lib/cgi-bin/nph-zms, referer: http://192.168.0.13/zm/index.php?view=watch&mid=1
Through the web interface I hit options, paths, and update PATH_ZMS from /cgi-bin/nph-zms to /zoneminder/cgi-bin/nph-zms, issue fixed.

Next I add a know good camera, HikVision DS-2CD2132-I. Currently working just fine in ZM 1.28.1 (FFMpeg, RTSP). Adds with out a problem and I can capture events. But when I go to stream, I get the following errors:

Code: Select all

Feb  9 15:34:58 zoneminder3 web_php[1363]: ERR [socket_sendto( /var/run/zm/zms-460734s.sock ) failed: No such file or directory]
Feb  9 15:34:58 zoneminder3 web_php[1363]: ERR [getStreamCmdResponse stream error: socket_sendto( /var/run/zm/zms-460734s.sock ) failed: No such file or directory - checkStreamForErrors()]
All that shows up on the screen is a box of the correct resolution with a broken icon. I have spent most of the day trying to resolve/google this issue... Any ideas?
Last edited by dingbatca on Wed Feb 10, 2016 6:57 pm, edited 2 times in total.

GDixon
Posts: 9
Joined: Sun Jan 31, 2016 11:40 pm

Re: Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by GDixon » Wed Feb 10, 2016 12:08 am

need Lamp server with ssh?

jmeurrens31
Posts: 1
Joined: Wed Feb 10, 2016 12:27 am

Re: Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by jmeurrens31 » Wed Feb 10, 2016 12:30 am

I am having the exact same error msg in the log as the original poster.

I did installed SSH and LAMP during my initial setup. There needs to be a better install guide or the option to be able to still install 1.28 from the repository.

jtech
Posts: 13
Joined: Thu Feb 04, 2016 5:37 pm

Re: Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by jtech » Wed Feb 10, 2016 4:23 pm

I seem to remember this issue affecting my Zoneminder after upgrading to 14.04 LTS.

My system is currently running 14.04 LTS and Zoneminder 1.26.5.

It's been a while since I had to set it up, but I think I had to change the following paths:

Under Options -> Paths -> PATH_MAP: /run/shm
Under Options -> Paths -> PATH_SWAP: /tmp/zm


If after changing the PATH_SWAP to "/tmp/zm" and restarting zoneminder it still gives you an error, you should check if the /tmp/zm folder exists and that the permissions are correct.

Right now I've got it listed as:
# ls -alh /tmp
..
drwx------ 5 www-data www-data 4.0K Feb 10 08:15 zm

Which confirms that www-data (Apache and zoneminder) can read/write to that /tmp/zm folder

dingbatca
Posts: 13
Joined: Tue Feb 09, 2016 11:36 pm

Re: Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by dingbatca » Wed Feb 10, 2016 4:43 pm

Well this sucks. So I matched my 1.28.1 and 1.29 system when it comes to packages at the Linux level. Broken.
Cloned my working 1.28.1 VM and did an upgrade. Broken.

At this point I think 1.29 has a bug beyond my skills to trouble shoot.

I am stumped. :-(

dingbatca
Posts: 13
Joined: Tue Feb 09, 2016 11:36 pm

Re: Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by dingbatca » Wed Feb 10, 2016 5:32 pm

I tried updating the paths as recommended by jtech. No luck. I check all paths and permissions. Everything looks good from a permissions stand point.

dingbatca
Posts: 13
Joined: Tue Feb 09, 2016 11:36 pm

Re: Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by dingbatca » Wed Feb 10, 2016 6:06 pm

FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED FIXED
NAILED IT! Oh how good it feels.
Two tweaks must be applied.
1) (Web interface) Options, paths, and update PATH_ZMS from "/cgi-bin/nph-zms" to "/zoneminder/cgi-bin/nph-zms"

Code: Select all

==> error.log <==
[Tue Feb 09 15:33:23.463262 2016] [cgi:error] [pid 1278] [client 192.168.0.222:62826] script not found or unable to stat: /usr/lib/cgi-bin/nph-zms, referer: http://192.168.0.13/zm/index.php?view=watch&mid=1
2) Must fix the pathing in apache to match the above configuration

Code: Select all

edit /etc/apache2/conf-available/zoneminder.conf
#ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
ScriptAlias /zoneminder/cgi-bin "/usr/lib/zoneminder/cgi-bin"

service apache2 restart
service zoneminder restart
Rebuilding my VM from scratch to make sure this applies to a clean configuration.

dingbatca
Posts: 13
Joined: Tue Feb 09, 2016 11:36 pm

Re: RESOLVED! Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by dingbatca » Wed Feb 10, 2016 10:17 pm

Here are my install notes for any one who wants a clean install. My ZoneMinder system is a VM running on-top of ESXi. All my cameras are network attached. Installing 1.29 version of ZoneMinder. I am a Linux Systems Administrator by trade, so my note might be a bit hard to follow if you are a Linux N00B.

Starting with Ubuntu 14.04 LTS ISO, OpenSSH is the only package I choose.

static networking

Switch to root, set root password, enable Root ssh login, remove the user account the installer forced me to make.

Code: Select all

sudo su -
passwd

vi /etc/ssh/sshd_config
#PermitRootLogin without-password
PermitRootLogin yes

deluser --remove-all-files fuzzy1
clean up everything deluser missed in etc

Add discard to / opting in fstab, which will be ignored... GRRR!

Install VMWare tools because this is a VM.

Code: Select all

apt-get install open-vm-tools
Installing ZoneMinder. Follow install process:
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

Setup the admin account with a password, enable login screen, and fix PATH_ZMS all through the web interface
--> In options, Users, set the admin password and language
--> In options, System, OPT_USE_AUTH
--> In options, Paths, PATH_ZMS from "/cgi-bin/nph-zms" to "/zoneminder/cgi-bin/nph-zms"

Must fix the pathing in apache to match PATH_ZMS

Code: Select all

edit /etc/apache2/conf-available/zoneminder.conf
#ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
ScriptAlias /zoneminder/cgi-bin "/usr/lib/zoneminder/cgi-bin"
Add SSL, follow "Optional Add SSL to Apache2"
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

Kill off port 80. Switch the SSL default site to point to zoneminder, removing the need for/zm (https://youserver now works)

Code: Select all

vi /etc/apache2/ports.conf
#Listen 80
rm -f /etc/apache2/sites-enabled/000-default.conf

vi /etc/apache2/sites-available/default-ssl.conf
                #DocumentRoot /var/www/html
                DocumentRoot /usr/share/zoneminder/www
                
service apache2 restart
service zoneminder restart
If you followed this installer from scratch, you might want to reboot to pick up the new kernel.

Start adding cameras and have fun!

bbunge
Posts: 2684
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: RESOLVED! Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by bbunge » Thu Feb 11, 2016 1:24 am

Why did you reinvent the wheel?

See: https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

FvdLaar
Posts: 9
Joined: Sat Apr 02, 2016 12:55 pm

Re: RESOLVED! Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by FvdLaar » Sun Apr 03, 2016 7:43 am

After installing 1.29 from ppa::iconnor still having the socket error: [socket_sendto( /var/run/zm/zms-841293s.sock ) failed: No such file or directory], referer: https://www.example.com/zm/index.php?view=watch&mid=1

Can't figure out why socket is not being made!

pr0fessor
Posts: 1
Joined: Sat May 13, 2017 7:15 pm

Re: Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by pr0fessor » Sat May 13, 2017 8:58 pm

dingbatca wrote:
Wed Feb 10, 2016 6:06 pm
...
Two tweaks must be applied.
1) (Web interface) Options, paths, and update PATH_ZMS from "/cgi-bin/nph-zms" to "/zoneminder/cgi-bin/nph-zms"
2) Must fix the pathing in apache to match the above configuration

Code: Select all

edit /etc/apache2/conf-available/zoneminder.conf
#ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
ScriptAlias /zoneminder/cgi-bin "/usr/lib/zoneminder/cgi-bin"

service apache2 restart
service zoneminder restart
...
Thank You very much. :D
Thease two tweaks helped me. But first i had to check that cgi-bin is working:
http://www.techrepublic.com/blog/diy-it ... he-server/ :
Configure Apache

A directive must be created so Apache knows about CGI — where its directories are located and what it can do. In some Apache configurations, this is done within the httpd.conf file. Because this is Ubuntu, we are going to add the directive to the /etc/apache/sites-available. Open that file with your favorite text editor and, before you add anything, search for this section:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

If the above section does not exist, add it in the <Virtualhost *:80> section just above the line:

ErrorLog ${APACHE_LOG_DIR}/error.log

Save that file and be ready to restart Apache. To restart the server, issue the command:

sudo service apache2 restart

Test it out:

Now it's time to test this baby out. Let's create a file (call it test.pl), and the file's contents should be:
#!/usr/bin/perl -w
print "Content-type: text/html\r\n\r\n";
print "Hello there!<br />\nJust testing .<br />\n";
for ($i=0; $i<10; $i++)
{
print $i."<br />";
}

Save that file in /usr/lib/cgi-bin and give it 755 permissions. Now open that file in your web browser (point the browser to http://IP_OF_SERVER/cgi-bin/test.pl where IP_OF_SERVER is the address of the server), and you should see the following:

Hello there!
Just testing .
1
2
3
4
5
6
7
8
9
I have install armbian (ubuntu 16.04) on orangepi zero, and zoneminder 1.30.4 (it installs mysql 7.0, so i had to correct paths from this guidance: https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way). with usb webcam.

adzm
Posts: 1
Joined: Tue Jun 13, 2017 11:16 pm

Re: RESOLVED! Clean install of Ubuntu 14.04 LTS + ZM 1.29, cant get it to work?!

Post by adzm » Tue Jun 13, 2017 11:23 pm

You don't have to modify the ScriptAlias in the Apache configuration file. Just provide the path defined in the conf for the Options -> Paths -> PATH_ZMS should be /zm/cgi-bin/nph-zms You don't have to restart apache either.

This seems to work with Ubuntu 16.04.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests