Page 1 of 1

Want Zoneminder to reside at root of IP address

Posted: Wed Oct 27, 2010 4:29 am
by btrotter
I just finished building Ubuntu 10.4 and installed Zoneminder 1.24.2

In order to get to my ZM server, I have to go to:
http://myipaddress/zoneminder

I would like to have it so that all I had to do was go to:
http://myipaddress
and that would take me to the Zoneminder homepage. How do I set that?

Posted: Wed Oct 27, 2010 5:47 am
by jdhar
As a quick hack you could do a PHP header(Location:) redirect in your index.php file in the root.

Alternately, the zoneminder.conf linked in your apache conf directory (eg: /etc/apache2/conf.d) contains an Alias for /zm (or /zoneminder in your case) pointing it to the ZM web-directory. You could remove this alias and set the 'DocumentRoot' parameter in your server apache configuration file to /usr/share/zoneminder (for example) instead, which will set that as the root.

Or take whatever directory serves as the root for your server right now, erase it and just symlink it to /usr/share/zoneminder... lots of ways around it :)

Posted: Wed Oct 27, 2010 6:27 am
by Flash_
All those would work, plus:

Google for "htaccess redirect" to redirect anyone going to / to /zm instead

Create a /index.html that immediately redirects the user to /zm/ on load.

Possibly copying the contents of /zm into / might work, but backup first as I've not tried it. You might then need to link /zm to / for anything that expects it in the old location.

Posted: Mon Nov 01, 2010 3:39 am
by racelife
The easy way to do it is to edit with nano or your favorite text editor "/etc/apache2/sites-enabled/000-default"

change:
DocumentRoot /var/www
to:
DocumentRoot /usr/share/zoneminder

and change:
<Directory>
to:
<Directory>

save and reboot.

Posted: Tue Nov 02, 2010 1:50 pm
by butlerm1977
If you wish to do this with Red Hat / Fedora / CentOS, try this...

nano /etc/httpd/conf/httpd.conf

<VirtualHost>
ServerAdmin me@me.com
DocumentRoot /var/www/html/zm
ServerName yourservername
ErrorLog /var/log/httpd/VirtualHost-error_log
CustomLog /var/log/httpd/VirtualHost-Custom-error_log common
</VirtualHost>