Page 1 of 1

zoneminder behind apache2 proxy error...

Posted: Fri Feb 27, 2009 9:30 am
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!

Posted: Sun Mar 01, 2009 9:11 pm
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.

Posted: Thu Mar 05, 2009 3:59 am
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!