API not working after install on fresh Buster system

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
jake1164
Posts: 4
Joined: Tue Aug 01, 2017 1:13 pm

API not working after install on fresh Buster system

Post by jake1164 » Fri Jul 12, 2019 11:37 am

I did a fresh Debian 10 (Buster) install following the posted instructions.

Upon restarting apache and before doing anything else ZM is running, logs are green, however when you navigate to :
http://ip/zm/api/host/getVersion.json results in a Not Found page.

The API directory (/usr/share/zoneminder/www/api) has the following files / folders:
app build.properties build.xml composer.json CONTRIBUTING.md index.php lib README.md

Note that the host folder is missing.

Navigating to http://ip/zm/api/ results in the following CakePHP error:
URL rewriting is not properly configured on your server. 1) Help me configure it 2) I don't / can't use URL rewriting

I followed the instructions a second time on a fresh VM and had the same results.

I have found a few fragments of other issues with buster api's but no definitive resolution.

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

Re: API not working after install on fresh Buster system

Post by bbunge » Fri Jul 12, 2019 8:39 pm

I must admit that I did not check the API as I seldom use anything other than a web browser. Will try to find time to load up Debian again and see what I can find.

JoshZ17
Posts: 2
Joined: Sun Sep 10, 2017 4:05 am

Re: API not working after install on fresh Buster system

Post by JoshZ17 » Sat Jul 13, 2019 2:07 am

I'm having the same issue. Fresh install of Buster.

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

Re: API not working after install on fresh Buster system

Post by bbunge » Sat Jul 13, 2019 2:26 am

Looks like all the files installed with correct permissions. Cake reports rewrite not working. Looking into Apache config. Seems sim to issues we had with Ubuntu 17.10.
Will continue in the morning...old guys need sleep, too.

girkers
Posts: 11
Joined: Wed Mar 22, 2017 12:08 am

Re: API not working after install on fresh Buster system

Post by girkers » Sat Jul 13, 2019 10:01 am

I spent a day trying buster without success and I ended up using CentOS instead.

User avatar
logicos94
Posts: 3
Joined: Sun May 09, 2010 10:03 pm

Re: API not working after install on fresh Buster system

Post by logicos94 » Sat Jul 13, 2019 10:53 am

Hi,

Some issues too in https/http support:

I noticed this:

Code: Select all

var monitorUrl = 'https://zm.eez.fr:80/zm/index.php';
My server is behind a "nginx/proxy" with "https" protocol.
But local http Apache server listen on port "80" with "http" protocol.

"SetEnv HTTPS on" is present in my "VirtualHost" configuration.

":80" is irrelevent here.
If I remove this , It's work like expected.

Regards,

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

Re: API not working after install on fresh Buster system

Post by bbunge » Sat Jul 13, 2019 12:21 pm

logicos94 wrote:
Sat Jul 13, 2019 10:53 am
Hi,

Some issues too in https/http support:

I noticed this:

Code: Select all

var monitorUrl = 'https://zm.eez.fr:80/zm/index.php';
My server is behind a "nginx/proxy" with "https" protocol.
But local http Apache server listen on port "80" with "http" protocol.

"SetEnv HTTPS on" is present in my "VirtualHost" configuration.

":80" is irrelevent here.
If I remove this , It's work like expected.

Regards,
But does your api work?

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

Re: API not working after install on fresh Buster system

Post by bbunge » Sat Jul 13, 2019 1:31 pm

There are some .htaccess files missing from the /usr/share/zoneminder/api directories. This may be the key to the API not working. May take me some time to figure this out as Saturday chores take preference...

sammyke007
Posts: 2
Joined: Mon Jul 15, 2019 11:18 am

Re: API not working after install on fresh Buster system

Post by sammyke007 » Mon Jul 15, 2019 11:19 am

Same here, fresh Debian 10 (Buster) installation and API's not working.

Chimaera
Posts: 17
Joined: Mon Apr 15, 2019 8:13 pm

Re: API not working after install on fresh Buster system

Post by Chimaera » Mon Jul 15, 2019 11:28 am

bbunge wrote:
Sat Jul 13, 2019 1:31 pm
There are some .htaccess files missing from the /usr/share/zoneminder/api directories. This may be the key to the API not working. May take me some time to figure this out as Saturday chores take preference...
This is the answer, you need to add the following code to .htaccess in 3 places

/usr/share/zoneminder/www/api
/usr/share/zoneminder/www/api/app
/usr/share/zoneminder/www/api/app/webroot

Code: Select all

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    RewriteBase /zm/api
</IfModule>

sammyke007
Posts: 2
Joined: Mon Jul 15, 2019 11:18 am

Re: API not working after install on fresh Buster system

Post by sammyke007 » Mon Jul 15, 2019 11:37 am

Tnx Chimaera! ZMNinja is connected!

Zoneminder + ZMNinja working fine now on an old Dell Optiplex 780 SFF running Debian 10!

jake1164
Posts: 4
Joined: Tue Aug 01, 2017 1:13 pm

Re: API not working after install on fresh Buster system

Post by jake1164 » Tue Jul 16, 2019 11:13 pm

Thanks! Now I can get my wife off my back about how I broke the cameras. :)

Post Reply

Who is online

Users browsing this forum: komatim and 4 guests