Debian 8 with Zoneminder 1.29.0 instructions

Forum for questions and support relating to the 1.29.x releases only.
Locked
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Debian 8 with Zoneminder 1.29.0 instructions

Post by bbunge »

I finally got around to updating the install instructions for Debian 8 using the backports to install Zoneminder 1.29.0:

https://wiki.zoneminder.com/Debian_8_64 ... e_Easy_Way

I do not plan to do an upgrade procedure for Debian but the process is much the same as Ubuntu 14.04. Just make sure you upgrade the database!
https://wiki.zoneminder.com/Common_Issu ... PA_version
jamesb
Posts: 14
Joined: Sat Feb 27, 2016 10:07 am

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by jamesb »

Hi I have a 1.29 zoneminder installation running Jessie from the backports repository.

Everything is up and running apart from the API (which is the reason i installed this version).

When I go to <URL>/zm/api i see the CakePHP screen with the red message stating:

Code: Select all

URL rewriting is not properly configured on your server.
I've added the following to my apache config:

Code: Select all

# Zoneminder
LoadModule rewrite_module libexec/apache2/mod_rewrite.so

Alias /zm /usr/share/zoneminder
ScriptAlias /zm/cgi /usr/lib/zoneminder/cgi-bin/

<Directory /usr/share/zoneminder>
  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>
</Directory>

<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
</Directory>
I found other threads mentioning this error but couldn't see anyone offering a solution. I don't know anything about CakePHP and the documentation just mentions the .htaccess settings which are already present in the zoneminder installation.

Does anyone know how to configure CakePHP to enable the API?
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by asker »

A user in the IRC channel reported a similar problem (But he was upgrading from 1.28 to 1.29)

We added this to /etc/apache2/conf-enabled/zoneminder.conf

Code: Select all

<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
</Directory>
Then do a

Code: Select all

sudo a2enmod rewrite
(should already be on, but no harm checking)

Then restart apache (important) and it worked for him

Your note above says you already added it to your apache config, but I don't know while file you are referring to and if you restarted apache
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by bbunge »

This did not work for me. Will try the other recommendation.
asker wrote:A user in the IRC channel reported a similar problem (But he was upgrading from 1.28 to 1.29)

We added this to /etc/apache2/conf-enabled/zoneminder.conf

Code: Select all

<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
</Directory>
Then do a

Code: Select all

sudo a2enmod rewrite
(should already be on, but no harm checking)

Then restart apache (important) and it worked for him

Your note above says you already added it to your apache config, but I don't know while file you are referring to and if you restarted apache
jamesb
Posts: 14
Joined: Sat Feb 27, 2016 10:07 am

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by jamesb »

It's working.

I'm hosting multiple sites on this server and found that my configuration was in a disabled site; oops!

Once I got it in the right place my configuration seems to be working for me.

Code: Select all

# Zoneminder
LoadModule rewrite_module libexec/apache2/mod_rewrite.so

Alias /zm /usr/share/zoneminder/www
ScriptAlias /zm/cgi /usr/lib/zoneminder/cgi-bin/

<Directory /usr/share/zoneminder>
  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>
</Directory>

<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
</Directory>
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by asker »

cool! Not quite sure why this is not part of the debian package
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
jamesb
Posts: 14
Joined: Sat Feb 27, 2016 10:07 am

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by jamesb »

jamesb wrote:It's working.
Well I spoke too soon, i've now got a different issue possibly with the cgi path?:

Code: Select all

socket_sendto( /var/run/zm/zms-472276s.sock ) failed: No such file or directory
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by asker »

Yup this is unrelated. You need to follow the debian guide and make sure PATH_ZMS is set correctly.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
jamesb
Posts: 14
Joined: Sat Feb 27, 2016 10:07 am

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by jamesb »

OK, now it's working and so is the zmNija app :D

Code: Select all

PATH_ZMS = /cgi-bin-zm/zms
Final apache config:
# Zoneminder
LoadModule rewrite_module libexec/apache2/mod_rewrite.so

Alias /zm /usr/share/zoneminder/www
ScriptAlias /cgi-bin-zm /usr/lib/zoneminder/cgi-bin

<Directory /usr/share/zoneminder>
php_flag register_globals off
Options Indexes FollowSymLinks
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
</Directory>

<Directory /usr/lib/zoneminder/cgi-bin>
AllowOverride All
Options +ExecCGI +FollowSymLinks
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
</Directory>

<Directory /usr/share/zoneminder/www/api>
AllowOverride All
</Directory>
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by bbunge »

Had this same issue with Ubuntu 15.10 after an upgrade to 1.29.0

Solved by doing:

chown -R www-data:www-data /usr/share/zoneminder/

You still need to edit /etc/apache2/conf-enabled/zoneminder.conf and add:

<Directory /usr/share/zoneminder/www/api>
AllowOverride All
</Directory>

Restart Apache

Works for Debian 8

Sometimes it takes me awhile to remember stuff!
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by bbunge »

Updated the WIKI install procedure:

https://wiki.zoneminder.com/Debian_8_64 ... e_Easy_Way
videoboom
Posts: 4
Joined: Fri Mar 18, 2016 11:23 pm

Re: Debian 8 with Zoneminder 1.29.0 instructions

Post by videoboom »

I have the same problem.

Follow the topic but not works :( no API works and "URL rewriting is not properly configured on your server. 1) Help me configure it 2) I don't / can't use URL rewriting" message in /zm/api
Locked