Want Zoneminder to reside at root of IP address

Forum for questions and support relating to the 1.24.x releases only.
Locked
btrotter
Posts: 57
Joined: Tue Jan 15, 2008 3:31 pm

Want Zoneminder to reside at root of IP address

Post 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?
User avatar
jdhar
Posts: 125
Joined: Fri Oct 01, 2010 9:15 pm
Location: California

Post 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 :)
Flash_
Posts: 441
Joined: Wed Jan 11, 2006 12:19 pm

Post 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.
racelife
Posts: 84
Joined: Mon Mar 22, 2010 11:38 pm

Post 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.
butlerm1977
Posts: 36
Joined: Wed Sep 09, 2009 4:47 pm

Post 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>
Locked