Page 1 of 1

Db on a different computer?

Posted: Wed Nov 07, 2007 1:45 pm
by occhiostanco
Is it possibile to configure ZM to work on a db on a different host?
(i mean not the same host were apache is)?

Thanks

Rob

Posted: Wed Nov 07, 2007 4:51 pm
by haus
Seems like it would be possible. From the user manual:
To build ZoneMinder the first thing you need to do is run the included configure script to define some
initial configuration. If you are happy with the default settings for the database host (‘localhost’), name
(‘zm’), user (‘zmuser’) and password (‘zmpass’) then you can just type
./configure --with-webdir=<your web directory> --with-cgidir=<your cgi directory>
It goes on to say other than DB name, you can change the host, user, pass variables at any time, so you might be able to do it on the fly.

Of course moving to another machine invites a layer of uncertainty (network, and another computer are two additional points of failure), but it sounds possible.

Posted: Wed Nov 07, 2007 6:12 pm
by occhiostanco
Thanks haus, i missed that manual page...

But I need to change things (db host) with ZM already
installed. So the question become:
"where is the <db host> parameter located, and can I change it?"

For clarity, I would try to explain what I want to do.
I have a ZM installed on a very low power computer (35W !!)
It is located in the backoffice and it's so busy (recording 8 cameras)
that is rather impossible to view events.

I want to install a second instance of zoneminder on my laptop
and use it to view events recorder by the "master" ZM.
The latter ZM (readonly mode!) should connect to the same db
and see, under apache, the same events recorded by the former...

Very odd, maybe

Thanks
Roberto

Posted: Wed Nov 07, 2007 8:41 pm
by haus
Interesting idea. I wonder how it will work. Anyway, I've only been playing with Zoneminder for short while now, but you might try installing phpmyadmin on your initial ZM box. All the variables seem to be in various tables in there. I did this on Ubuntu:

apt-get install phpmyadmin

then go to a browser and type:

http://<ip_of_zm_box>/phpmyadmin

login as root with blank password (you probably want to secure that at some point before putting this box on the network, but it'll do for now). Then you should see a list of databases on localhost and hopefully you can find the DB_HOST, User, and pass entries. I'm only guessing here; I haven't done this myself, but it seems ZM stores most of the relevant config into in mysql tables.

Good luck; let us know how things work.

Posted: Thu Nov 08, 2007 10:22 am
by occhiostanco
haus wrote:Interesting idea. I wonder how it will work. Anyway, I've only been playing with Zoneminder for short while now, but you might try installing phpmyadmin on your initial ZM box. All the variables seem to be in various tables in there. I did this on Ubuntu:

apt-get install phpmyadmin

then go to a browser and type:

http://<ip_of_zm_box>/phpmyadmin

login as root with blank password (you probably want to secure that at some point before putting this box on the network, but it'll do for now). Then you should see a list of databases on localhost and hopefully you can find the DB_HOST, User, and pass entries. I'm only guessing here; I haven't done this myself, but it seems ZM stores most of the relevant config into in mysql tables.

Good luck; let us know how things work.
Thanks...
I' ll give a try and a feedback within some days

bye

Posted: Thu Nov 08, 2007 11:15 am
by kevin_robson
If I understand corectly, Somehow you are going to have to replicate the event images across to the front end machine. This may be more CPU intensive than viewing on that machine.

Could you maybe use rsync to replicate your events folder, zm php files and DB datafiles to the frontend machine and run ZM from there perhaps?

Posted: Thu Nov 08, 2007 1:05 pm
by occhiostanco
kevin_robson wrote:If I understand corectly, Somehow you are going to have to replicate the event images across to the front end machine. This may be more CPU intensive than viewing on that machine.

Could you maybe use rsync to replicate your events folder, zm php files and DB datafiles to the frontend machine and run ZM from there perhaps?
No, kevin. I don't plan to replicate events. I plan to setup event directory
as a samba share over the LAN, map that share on the frontend computer,
and alias it in apache (frontend).

I will leave a feedback about this

Roberto

Posted: Thu Nov 08, 2007 1:19 pm
by occhiostanco
I have taken a look to phpadmin and it's very smart!

However you can't store connection info in a database table, since
you need to know them BEFORE opening the database javascript:emoticon(':D')

Anyway I have found they are in /usr/local/etc/zm.conf
(or /etc/zm/zm.conf in the packaged ubuntu version)

Bye
occhiostanco wrote:
haus wrote:Interesting idea. I wonder how it will work. Anyway, I've only been playing with Zoneminder for short while now, but you might try installing phpmyadmin on your initial ZM box. All the variables seem to be in various tables in there. I did this on Ubuntu:

apt-get install phpmyadmin

then go to a browser and type:

http://<ip_of_zm_box>/phpmyadmin

login as root with blank password (you probably want to secure that at some point before putting this box on the network, but it'll do for now). Then you should see a list of databases on localhost and hopefully you can find the DB_HOST, User, and pass entries. I'm only guessing here; I haven't done this myself, but it seems ZM stores most of the relevant config into in mysql tables.

Good luck; let us know how things work.
Thanks...
I' ll give a try and a feedback within some days

bye
:D :D

Posted: Thu Nov 08, 2007 4:18 pm
by haus
LOL good point. :))))

Can't believe I wrote that.