Page 1 of 1

API config issues. Diag in post!

Posted: Mon May 29, 2017 7:17 pm
by schott1984
Some info pasted below based on diag info requested in other threads.

Code: Select all

root@zmdebian:/var/log/apache2# curl http://192.168.1.140/zm/api/host/getVersion.json
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /zm/api/host/getVersion.json was not found on this server.</p>
<hr>
<address>Apache/2.4.10 (Debian) Server at 192.168.1.140 Port 80</address>
</body></html>

Code: Select all

root@zmdebian:/var/log/apache2# 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@zmdebian:/var/log/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>

Code: Select all

root@zmdebian:/var/log/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>

Code: Select all

root@zmdebian:/var/log/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>
And proof that rewrite is on

Code: Select all

root@zmdebian:/var/log/apache2# sudo a2enmod rewrite
Module rewrite already enabled

Code: Select all

root@zmdebian:/usr/share/zoneminder/www/api# ls -l
total 40
drwxr-xr-x 14 root root  4096 May 29 14:46 app
-rw-r--r--  1 root root   174 Feb  3  2016 build.properties
-rw-r--r--  1 root root 10315 Feb  3  2016 build.xml
-rw-r--r--  1 root root   837 Feb  3  2016 composer.json
-rw-r--r--  1 root root  3252 Feb  3  2016 CONTRIBUTING.md
-rw-r--r--  1 root root  1454 Feb  3  2016 index.php
drwxr-xr-x  3 root root  4096 May 29 14:46 lib
-rw-r--r--  1 root root   437 Feb  3  2016 README.md
Can anyone lend a hand? Appreciate it!

Re: API config issues. Diag in post!

Posted: Tue May 30, 2017 1:41 am
by bbunge
Did you use this install procedure? See the API fix...

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

Re: API config issues. Diag in post!

Posted: Tue May 30, 2017 2:03 am
by schott1984
bbunge wrote: Tue May 30, 2017 1:41 am Did you use this install procedure? See the API fix...

https://wiki.zoneminder.com/Debian_8_64 ... e_Easy_Way
I've since change the permissions and edited that conf and now error 500...

I can post more detail tomorrow evening.