API configuration issues
API configuration issues
Hello,
I recently upgraded to 1.29 and am trying to setup the API for use with zmnija. I followed the guide posted on the wiki for apache and zm configuration but I can't get the app to talk to the API. When I do http://serverip/zm/api: I get "The requested URL /zm/api was not found on this server."
http://serverip/zm/api/host/getVersion.json I don't see anything. I actually don't even have a host folder in my api directory.
Everything in /usr/share has the same user/owner (www-data). My apache2.conf has entries described on the wiki. Not sure what else I could be missing.
Thanks
I recently upgraded to 1.29 and am trying to setup the API for use with zmnija. I followed the guide posted on the wiki for apache and zm configuration but I can't get the app to talk to the API. When I do http://serverip/zm/api: I get "The requested URL /zm/api was not found on this server."
http://serverip/zm/api/host/getVersion.json I don't see anything. I actually don't even have a host folder in my api directory.
Everything in /usr/share has the same user/owner (www-data). My apache2.conf has entries described on the wiki. Not sure what else I could be missing.
Thanks
Last edited by bforcier on Tue Aug 30, 2016 11:57 pm, edited 2 times in total.
Re: API configuration issues
How exactly did you upgrade? Which guide did you follow?
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
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
Re: API configuration issues
I removed with purge, autoremove, and cleared the zm database then followed this:
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way
Re: API configuration issues
If you followed that guide verbatim and are sure you did not miss steps, then the Api parh should be server/zm/api not server/api as you wrote below?
bforcier wrote:I removed with purge, autoremove, and cleared the zm database then followed this:
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way
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
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
Re: API configuration issues
Yes. Sorry about that http://serverip/zm/api is what was configured (edited in original) this returns 404.
Re: API configuration issues
Try these, and please post the exact output from all of these. Thanks.
Code: Select all
sudo a2enmod rewrite
Code: Select all
cat /usr/share/zoneminder/www/api/.htaccess
Code: Select all
cat /usr/share/zoneminder/www/api/app/.htaccess
Code: Select all
cat /usr/share/zoneminder/www/api/app/webroot/.htaccess
Code: Select all
cat /etc/apache2/conf-enabled/zoneminder.conf #replace zoneminder.conf with any other config you may be using
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
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
Re: API configuration issues
hi, asker!
We have same problem weet API. ZM works good, but our chief wants to explore cameras from he's smartphone (iPhone 6). We have bought zmninja from AppMarket, then install it, But ZMNinja request an API.
My API doesn't work, i' got error (see attachment)
What would i do?
Linux Debian 8.0
ZM 1.29.0
I'm trying by your steps:
We have same problem weet API. ZM works good, but our chief wants to explore cameras from he's smartphone (iPhone 6). We have bought zmninja from AppMarket, then install it, But ZMNinja request an API.
My API doesn't work, i' got error (see attachment)
What would i do?
Linux Debian 8.0
ZM 1.29.0
I'm trying by your steps:
Code: Select all
root@stk-video-01:/etc/apache2# a2enmod rewrite
Module rewrite already enabled
root@stk-video-01:/etc/apache2# cat /usr/share/zoneminder/www/api/.htaccess
cat: /usr/share/zoneminder/www/api/.htaccess: No file or directory is found
root@stk-video-01:/etc/apache2# cat /usr/share/zoneminder/www/api/app/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
RewriteBase /zm/api
</IfModule>
root@stk-video-01:/etc/apache2# cat /usr/share/zoneminder/www/api/app/webroot/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteBase /zm/api
</IfModule>
root@stk-video-01:/etc/apache2# cat /etc/apache2/conf-enabled/zoneminder.conf
# Remember to enable cgi mod (i.e. "a2enmod cgi").
ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
<Directory "/usr/lib/zoneminder/cgi-bin">
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AllowOverride All
Require all granted
</Directory>
Alias /zm /usr/share/zoneminder/www
<Directory /usr/share/zoneminder/www>
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>
root@stk-video-01:/etc/apache2#
- Attachments
-
- cakephp error.jpg (205.75 KiB) Viewed 7925 times
Re: API configuration issues
Are you sure you did
sudo a2enmod rewrite
edit: looks like you already did it
How exactly did you upgrade?
sudo a2enmod rewrite
edit: looks like you already did it
How exactly did you upgrade?
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
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
Re: API configuration issues
Hmm, looks like your .htaccess file is missing in api/ - not sure how you upgraded
Try this:
Try this:
Code: Select all
cp /usr/share/zoneminder/www/api/app/.htaccess /usr/share/zoneminder/www/api/.htaccess
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
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
Re: API configuration issues
Thanx, i tried to
then try to open.
I have no upgrade to 1.29.0
Clear install was be with 1.29.0 version.
Code: Select all
root@stk-video-01:/etc/apache2# cp /usr/share/zoneminder/www/api/app/.htaccess /usr/share/zoneminder/www/api/.htaccess
I have no upgrade to 1.29.0
Clear install was be with 1.29.0 version.
- Attachments
-
- internal error.jpg (68.25 KiB) Viewed 7884 times
Re: API configuration issues
Thanx a lot, asker!
I have solved my problem.
Problem was in file:
In this case API doesn't work. But i turn on my other ZM server and make:
Then, i corrected my /usr/share/zoneminder/www/api/.htaccess file and paste "app", reload apache2 and GOOD!
THANX!
I have solved my problem.
Problem was in file:
Code: Select all
root@stk-video-01:/usr/share/zoneminder/www/api# cat /usr/share/zoneminder/www/api/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ /webroot/ [L]
RewriteRule (.*) /webroot/$1 [L]
RewriteBase /zm/api
</IfModule>
Code: Select all
root@stk-video-01:/usr/share/zoneminder/www/api# cat /usr/share/zoneminder/www/api/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
RewriteBase /zm/api
</IfModule>
THANX!
- Attachments
-
- api_work.jpg (331.79 KiB) Viewed 7881 times