API config issues. Diag in post!
Posted: Mon May 29, 2017 7:17 pm
Some info pasted below based on diag info requested in other threads.
And proof that rewrite is on
Can anyone lend a hand? Appreciate it!
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>
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