There aren't any in the default distribution so they'll need to be created manually with nano or vim or something.david1234 wrote: ↑Sun Dec 19, 2021 8:07 am where are thefiles?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 ,
API not working after install on fresh Buster system
Re: API not working after install on fresh Buster system
Re: API not working after install on fresh Buster system
OK
this is what I have done:
1. created 3 file caled ".htaccess" in all 3 places
2. In all of them I wrote this configuration?
3. reboot apache2 and zonminder service
4. zoneminder is working (get video and monitor is running)
but this is what I get
do I need to change anything else? another file?
Thanks ,
this is what I have done:
1. created 3 file caled ".htaccess" in all 3 places
Code: Select all
/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>
4. zoneminder is working (get video and monitor is running)
but this is what I get
Code: Select all
pi@raspberrypi:~ $ sudo curl -X POST http://10.0.0.113/zm/api/getVersion.json
{
"code": 404,
"name": "Controller class GetVersionController could not be found.",
"message": "Controller class GetVersionController could not be found.",
"url": "\/zm\/api\/getVersion.json"
}pi@raspberrypi:~ $ sudo curl -X POST http://10.0.0.113/zm/host/api/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 was not found on this server.</p>
<hr>
<address>Apache/2.4.38 (Raspbian) Server at 10.0.0.113 Port 80</address>
</body></html>
Thanks ,
Re: API not working after install on fresh Buster system
Make sure that overrides are enabled in the httpd/Apache config file - They aren't by default in my copy here on CentOS.
Make a backup of the current conf:
Open the original in a text editor and look for this block:
Change the line that says AllowOverride None to AllowOverride All and then save the file and restart Apache.
Make a backup of the current conf:
Code: Select all
cp -p /etc/zm/www/zoneminder.conf /etc/zm/www/zoneminder.conf~
Code: Select all
Alias /zm "/usr/share/zoneminder/www"
<Directory "/usr/share/zoneminder/www">
# explicitly set index.php as the only directoryindex
DirectoryIndex disabled
DirectoryIndex index.php
SSLRequireSSL
Options -Indexes +MultiViews +FollowSymLinks
AllowOverride None
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order deny,allow
Allow from all
</IfModule>
</Directory>
Re: API not working after install on fresh Buster system
I don't have this file
how could it be ?
this is what I have:
do you mean to change the zm.conf?
how could it be ?
Code: Select all
cp -p /etc/zm/www/zoneminder.conf /etc/zm/www/zoneminder.conf~
cp: cannot stat '/etc/zm/www/zoneminder.conf': No such file or directory
Code: Select all
pi@raspberrypi:~ $ ls -lstrah /etc/zm/
total 40K
4.0K -rwxr----- 1 root www-data 1.8K Feb 11 2019 zm.conf
4.0K drwxr-xr-x 2 root root 4.0K Nov 1 12:40 conf.d
16K -rw-r--r-- 1 root root 15K Nov 1 12:40 core.php
4.0K drwxr-xr-x 3 root root 4.0K Nov 1 12:40 .
12K drwxr-xr-x 126 root root 12K Nov 1 13:29 ..