Help with API \ unable to connect "error 404"

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
david1234
Posts: 96
Joined: Wed Jun 26, 2019 12:24 pm

Help with API \ unable to connect "error 404"

Post by david1234 »

Hello ,
I have zoneminder v1.32.3 install on mp PI4,
I have install everything according to this guide :
and it's working without ay problem.

have try to use API , but I get error:

Code: Select all

curl -XPOST -d "user=David&pass=Davidpass" http://10.0.0.113/zm/api/host/login.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>

Code: Select all

in options-system :

OPT_USE_AUTH - is checked

AUTH_HASH_SECRET - 123!@!@!@Fvn43
when I try to enter http://10.0.0.113/zm/api/
I get a page:

Code: Select all

Release Notes for CakePHP 2.10.11.
Your version of PHP is 5.2.8 or higher.

Your tmp directory is writable.

The ApcEngine is being used for core caching. To change the config edit APP/Config/core.php

Your database configuration file is present.

CakePHP is able to connect to the database.
when I try to enter
http://10.0.0.113/zm/api/getVersion.json
http://10.0.0.113/zm/api/host/getVersion.json

I get:

Code: Select all

Not Found
The requested URL was not found on this server.

Apache/2.4.38 (Raspbian) Server at 10.0.0.113 Port 80
also I have check on pyzm and did all this :

Code: Select all

Make sure you have the following settings in ZM:
AUTH_RELAY is set to hashed
A valid AUTH_HASH_SECRET is provided (not empty)
AUTH_HASH_IPS is disabled
OPT_USE_APIS is enabled
If you are using any version lower than ZM 1.34, OPT_USE_GOOG_RECAPTCHA is disabled
what is missing?

Thanks ,
david1234
Posts: 96
Joined: Wed Jun 26, 2019 12:24 pm

Re: Help with API \ unable to connect "error 404"

Post by david1234 »

can anyone see waht\whre is the problem?

I have also check the apache2 file and this is all I have there :

Code: Select all

pi@raspberrypi:~ $ cat /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

?

Thanks ,
Post Reply