API not working after install on fresh Buster system
API not working after install on fresh Buster system
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.
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.
Re: API not working after install on fresh Buster system
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.
Re: API not working after install on fresh Buster system
I'm having the same issue. Fresh install of Buster.
Re: API not working after install on fresh Buster system
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.
Will continue in the morning...old guys need sleep, too.
Re: API not working after install on fresh Buster system
I spent a day trying buster without success and I ended up using CentOS instead.
--
Girkers
Girkers
Re: API not working after install on fresh Buster system
Hi,
Some issues too in https/http support:
I noticed this:
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,
Some issues too in https/http support:
I noticed this:
Code: Select all
var monitorUrl = 'https://zm.eez.fr:80/zm/index.php';
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,
Re: API not working after install on fresh Buster system
But does your api work?logicos94 wrote: ↑Sat Jul 13, 2019 10:53 am Hi,
Some issues too in https/http support:
I noticed this:
My server is behind a "nginx/proxy" with "https" protocol.Code: Select all
var monitorUrl = 'https://zm.eez.fr:80/zm/index.php';
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,
Re: API not working after install on fresh Buster system
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...
-
- Posts: 9
- Joined: Mon Jul 15, 2019 11:18 am
Re: API not working after install on fresh Buster system
Same here, fresh Debian 10 (Buster) installation and API's not working.
Re: API not working after install on fresh Buster system
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>
-
- Posts: 9
- Joined: Mon Jul 15, 2019 11:18 am
Re: API not working after install on fresh Buster system
Tnx Chimaera! ZMNinja is connected!
Zoneminder + ZMNinja working fine now on an old Dell Optiplex 780 SFF running Debian 10!
Zoneminder + ZMNinja working fine now on an old Dell Optiplex 780 SFF running Debian 10!
Re: API not working after install on fresh Buster system
Thanks! Now I can get my wife off my back about how I broke the cameras.
Re: API not working after install on fresh Buster system
I have the same problem using v 1.34
where do I need to add the code part?
do I need to create .htaccess file?
and then write into it the code?
this is what I have in this library
can you exaplin what did you do ?
Thanks ,
where do I need to add the code part?
do I need to create .htaccess file?
and then write into it the code?
this is what I have in this library
Code: Select all
pi@raspberrypi:~$ ls -lstra /usr/share/zoneminder/www/api/app/webroot/
total 28
4 -rw-r--r-- 1 root root 3006 Jun 6 18:07 test.php
4 -rw-r--r-- 1 root root 3170 Jun 6 18:07 index.php
4 -rw-r--r-- 1 root root 372 Jun 6 18:07 favicon.ico
4 drwxr-xr-x 2 root root 4096 Jun 18 13:38 img
4 drwxr-xr-x 2 root root 4096 Jun 18 13:38 css
4 drwxr-xr-x 10 root root 4096 Jun 18 13:38 ..
4 drwxr-xr-x 4 root root 4096 Jun 18 13:38 .
Thanks ,
-
- Posts: 1
- Joined: Sat Sep 18, 2021 5:27 pm
Re: API not working after install on fresh Buster system
Thanks Chimaera! This worked on my Pi 4 running Zoneminder 1.32.3 for RaspbianChimaera wrote: ↑Mon Jul 15, 2019 11:28 amThis 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>
Re: API not working after install on fresh Buster system
where are the files?
I can't see them
when I searc them I get empty response
?
Thanks ,
Code: Select all
.htaccess
I can't see them
when I searc them I get empty response
Code: Select all
pi@raspberrypi:~ $ sudo find /usr/share/zoneminder/ -name .htaccess
pi@raspberrypi:~ $
Thanks ,