Page 1 of 1

Apache Config

Posted: Sat Aug 10, 2013 2:14 pm
by tobylarone
Hi All,

I've managed to set up ubuntu server and zone minder web interface opens up fine when i go to 192.168.0.16/zm, but how can i make zoneminder be the root of the ip? I want to be able to just type in the ip address and the web interface come up.

I'm sure it's just a change to apache config files but not sure how it's done.

Thanks for any help!

Re: Apache Config

Posted: Sun Aug 11, 2013 10:39 pm
by knight-of-ni
Find your httpd.conf file and edit DocumentRoot to point to the directory you want.

However, what I have done instead was edit the default index.html in the DocumentRoot folder to auto-redirect to your zoneminder page. It is a very simple amount of html.

That way when users enter www.mywebpage.org, it would auto-redirect to www.mywebpage.org/zm, and if I ever decided to add something else that requires a web server, it would not conflict with zoneminder.

Re: Apache Config

Posted: Mon Aug 12, 2013 5:15 pm
by tobylarone
Hi,

Thanks for the reply, but my httpd.conf file is totally empty? There's no DocumentRoot anywhere. I'm looking under /etc/apache2/ but nothing

Thanks

Re: Apache Config

Posted: Mon Aug 12, 2013 6:01 pm
by knight-of-ni
Right, Ubuntu. They do things a little differently.

Try this file: /etc/apache2/sites-available/default

If that doesn't work then do this to find where it has been hidden:

Code: Select all

cd /etc/apache2
grep -r DocumentRoot ./

Re: Apache Config

Posted: Mon Aug 12, 2013 7:10 pm
by tobylarone
You were right it was under sites-available>default and doc root is set to >var>xxx.

Now I tried changing this to var>xxx>zm but obviously that didn't work because it is not installed there! I suspect it's something to do with zoneminder.conf which looks like:

Code: Select all

Alias >zm>usr>share>zoneminder

<Directory >usr>share>zoneminder>
  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  <IfModule>
<Directory>
~               
I thought I could just change the alias to

Code: Select all

  >usr>share>zoneminder 
but that didn't serve anything up (after I restarted apache).

So I'm not sure where it is set?

Thanks
(by the way i've had to switch / to > and www to xxx as the forum think's i'm spamming with URLs)

Re: Apache Config

Posted: Mon Aug 12, 2013 7:37 pm
by knight-of-ni
Not sure if Apache will let you Alias the documentroot. I wouldn't be surprised if it didn't.

You should be able to set DocumentRoot=/usr/share/zoneminder
Comment out the entire contents of zonemidner.conf (don't delete it). Forgot about that.
Then restart apache

Check to make sure that www-data has permission to read /usr/share/zoneminder, but that should already be set.

Yet another way would be to leave all your config files alone and:
sudo mv /var/www to /var/www-back
sudo ln -s /usr/share/zoneminder /var/www

Now are you sure you don't want to just edit /var/www/index.html and put an html redirect to {yourwbesite}/zm? :-)
It's by far the least hackish.

Re: Apache Config

Posted: Mon Aug 12, 2013 7:44 pm
by tobylarone
Yes to be honest it's not actually a big deal for me to type the full address followed by /zm, i've mainly been just trying to learn a bit more about how apache works. it's been a bit of a dark art up until now so thanks for the help.

Now I just need to buy some cameras and work out how to pass them through from Windows server to the ubuntu server through hyper-v! should be interesting!