zoneminder behind apache2 proxy error...

Forum for questions and support relating to the 1.24.x releases only.
Locked
szimszon
Posts: 26
Joined: Mon Nov 27, 2006 8:41 pm

zoneminder behind apache2 proxy error...

Post by szimszon »

Hello!

I wonder if somebody could help me.

I tried to run zoneminder behind an apache2 proxy - why? it's a long story.

But after I log in to zoneminder I got this answer:

Code: Select all

...
  <script type="text/javascript" src="tools/mootools/mootools.js"></script>
  <script type="text/javascript" src="js/mootools.ext.js"></script>
  <script type="text/javascript">
  var AJAX_TIMEOUT = 10000;

  var currentView = 'postlogin';
  var thisUrl = "http://192.168.55.2/zm/index.php";
  var skinPath = "skins/classic";

  var canEditSystem = true;
  var canViewSystem = true;

  var refreshParent = false;

  var focusWindow = false;
...
In that answer I got:

Code: Select all

var thisUrl = "http://192.168.55.2/zm/index.php";
I think it is calculated from the request but it's in the body so apache can't rewrite it to something like http://domain.tld/zm/index.php

Is it possible to use relative urls in javascript and html code?

Thank you!
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Can you try and edit web/skins/classic/js/skin.js.php and find the line

Code: Select all

  var thisUrl = "<?= ZM_BASE_URL.$_SERVER['PHP_SELF'] ?>";
and change it to

Code: Select all

var thisUrl = "<?= $_SERVER['PHP_SELF'] ?>";
and see if that makes any difference?

I'm not sure it will as some of the ajax requests need to use a full url I think but give it a try. Or you can edit web/index.php and hardcode the ZM_BASE_URL to your desired value.
Phil
trschober
Posts: 2
Joined: Thu Mar 05, 2009 3:53 am

Post by trschober »

I've not tried 1.24 yet, but in 1.23, you could edit /usr/share/zoneminder/zm.php
and change the line that goes

define( "ZM_BASE_URL", $protocol.'://'.$_SERVER['HTTP_HOST'] );

for

define( "ZM_BASE_URL", 'http://your.server.address.as.seen.from.outside' );

I've been doing that for a while so ZM works behind an apache proxy

hope it helps!
Locked