Proxypass and api

Forum for questions and support relating to 1.33.x development only.
Locked
fennec
Posts: 59
Joined: Thu Mar 20, 2014 1:17 am

Proxypass and api

Post by fennec »

Hi

I manage 3 servers zoneminder, i use another server with openvpn to 3 servers

I use letsencrypt for https on server and after proxy pass to other server

I can't have api ....

On local server zoneminder is ok like http://iplocal/zm

This is my apache config for one server

For each server i have different port

Code: Select all

<VirtualHost *:448>
        ServerName zon.ddns.net
        SSLEngine On
        SSLProxyEngine On
        SSLCertificateFile      /etc/letsencrypt/live/zon.ddns.net-0001/fullchain.pem
        SSLCertificateKeyFile   /etc/letsencrypt/live/zon.ddns.net-0001/privkey.pem
        ProxyRequests Off
        ProxyPreserveHost On
        ProxyVia On
        <Proxy *>
                Require all granted
        </Proxy>
        ProxyPass /zm http://11.0.0.186/zm/
        ProxyPassReverse /zm http://11.0.0.186/zm/
        ProxyPass /cgi-bin http://11.0.0.186/cgi-bin
        ProxyPassReverse /cgi-bin http://11.0.0.186/cgi-bin

        RequestHeader set X-Forwarded-Proto "https"
        RequestHeader set X-Forwarded-Port "448"


</VirtualHost>
I can view live but not video replay and no access api

Code: Select all

Missing Controller
Error: Controller could not be found.

Error: Create the class Controller below in file: app/Controller/Controller.php

<?php
class Controller extends AppController {

}
Notice: If you want to customize this error message, create app/View/Errors/missing_controller.ctp

Stack Trace
Do you have a idea ?

Thanks a lot
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Proxypass and api

Post by iconnor »

I use that setup myself and it works fine.

There is something wrong with your config. Let's see your apache configs on the backend devices.
fennec
Posts: 59
Joined: Thu Mar 20, 2014 1:17 am

Re: Proxypass and api

Post by fennec »

iconnor wrote: Wed Aug 28, 2019 1:33 pm I use that setup myself and it works fine.

There is something wrong with your config. Let's see your apache configs on the backend devices.
Thanks a lot for your help

this my conf on one server
fennec@Serveur_Ubuntu:/etc/apache2/conf-available$ cat 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>

# Order matters. This alias must come first.
Alias /zm/cache /var/cache/zoneminder/cache
<Directory /var/cache/zoneminder/cache>
Options -Indexes +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>

Alias /zm /usr/share/zoneminder/www
<Directory /usr/share/zoneminder/www>
Options -Indexes +FollowSymLinks
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
</Directory>

# For better visibility, the following directives have been migrated from the
# default .htaccess files included with the CakePHP project.
# Parameters not set here are inherited from the parent directive above.
<Directory "/usr/share/zoneminder/www/api">
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
RewriteBase /zm/api
</Directory>

<Directory "/usr/share/zoneminder/www/api/app">
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
RewriteBase /zm/api
</Directory>

<Directory "/usr/share/zoneminder/www/api/app/webroot">
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteBase /zm/api
</Directory>
fennec@Serveur_Ubuntu:/etc/apache2/conf-available$
fennec
Posts: 59
Joined: Thu Mar 20, 2014 1:17 am

Re: Proxypass and api

Post by fennec »

i add this and now api is ok
ProxyPass /cgi-bin http://11.0.0.186/cgi-bin
ProxyPassReverse /cgi-bin http://11.0.0.186/cgi-bin
ProxyPass /zm/api http://11.0.0.186/zm/api
ProxyPassReverse /zm/api http://11.0.0.186/zm/api
ProxyPass /api http://11.0.0.186/zm/api
ProxyPassReverse /api http://11.0.0.186/zm/api
ProxyPass /zm http://11.0.0.186/zm/
ProxyPassReverse /zm http://11.0.0.186/zm/

RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "448"

but on ZMninja no error when i logging

but no image on live on all monitor
AM DEBUG Image load error for monitor: 12 sceduling for connkey regen in 2s
Locked