Page 1 of 1

Solved installation problems caused by apache settings

Posted: Sat Sep 18, 2010 1:05 am
by robolo
I had a working installation of Zoneminder 1.23 on a Centos 5 computer which was also running Asterisk. Since I was not content to have everything working I decided to upgrade to Zoneminder 1.24.2.

Followed instructions in various places I got everything installed but when trying to run the Zoneminder web console for the first time I got a "Cannot open config file" message.

After searching forums I tried changing permissions (chmod) on the file /var/www/html/zm/index.php. After that I was able to get the web console to open but the status of Zoneminder was always reported as "Stopped". Trying to change the run state through the web console never changed the reported status. This was even though the Zoneminder service was actually running. Further forum searches suggested this behavior could be due to SELinux settings but I had already disabled it.

At the same time in the logs I was also getting various permission errors including denial of access to /dev/video. Changing file permissions of the /dev/video files did not help get the program working.

After a few days of struggles I uninstalled the new version of Zoneminder and decided to go back to the previous working version. Of course after reinstalling the old version I had the exact same problems as with the new version.

THE CAUSE
It turns out when I had installed Asterisk originally on this computer it was recommended to change the User and Group that Apache runs under to "asterisk". I found these settings in the /etc/httpd/conf/httpd.conf file (apache configuration file in Centos/Fedora) around line 230.

Code: Select all

#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
#  . On HPUX you may not be able to use shared memory as nobody, and the
#    suggested workaround is to create a user www and use that user.
#  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
#  when the value of (unsigned)Group is above 60000;
#  don't use Group #-1 on these systems!
#
User asterisk
Group asterisk
THE SOLUTION
I compiled the new version of zoneminder including " --with-webuser=asterisk --with-webgroup=asterisk" as part of the ./configure options. Now everything works perfectly. All errors corrected.

This probably would not be a solution for a brand new OS install since it will always have the apache User and Group as "apache". But if you have a preexisting OS and especially if there is another program sharing the same computer it might be worthwhile to check and make sure you had not changed the User/Group settings for apache. I happy to say this solved 3 days of frustration for me and I love ZoneMinder.

Robert