Error after clean install.
Error after clean install.
I just installed ZM 1.25.0 on a 32bit Arch Linux system. Everything was installed via pacman except for ZoneMinder which I compiled from source. Everything installed and ZM starts with out giving any errors. When I go the the web page for ZM I get an error saying. "Could not open config file."
I checked my Apache logs I get an error saying.
"PHP Warning: fopen(/usr/local/etc/zm.conf): failed to open stream: Operation not permitted in /srv/http/zm/includes/config.php on line 37"
My web server and ZM services are running as the user and group http. Permissions on the file zm.conf are
"-rwxr-xr-x 1 http http 1392 Dec 17 14:22 zm.conf"
I've checked the path in config.php and it is pointing to the directory where zm.conf is located (/usr/local/etc/zm.conf).
Does anyone know why I could be getting this error?
Thank you in advanced.
I checked my Apache logs I get an error saying.
"PHP Warning: fopen(/usr/local/etc/zm.conf): failed to open stream: Operation not permitted in /srv/http/zm/includes/config.php on line 37"
My web server and ZM services are running as the user and group http. Permissions on the file zm.conf are
"-rwxr-xr-x 1 http http 1392 Dec 17 14:22 zm.conf"
I've checked the path in config.php and it is pointing to the directory where zm.conf is located (/usr/local/etc/zm.conf).
Does anyone know why I could be getting this error?
Thank you in advanced.
Re: Error after clean install.
After looking at the error more I had to add /usr/local/etc to my php.ini config file. It had to be added to the line that starts open_basedir.
After doing this I started getting another error in my apache log.
[Sun Dec 18 22:48:27 2011] [error] [client 192.168.1.66] PHP Fatal error: require_once(): Failed opening required 'includes/functions.php' (include_path='.:/usr/share/pear') in /srv/http/zm/index.php on line 97
I also get a blank page when I pull up the zone minder site on my server. I changed the permissions on /usr/share/pear so that everyone has read/write access to this folder. It is currently empty so I don't know if ZM is suppose to have something in there. I restarted apache and zone minder but this hasn't helped. The folder is owned by root along with all other folders in the directory /usr/share. The group is also root.
Any thoughts?
Thank you.
After doing this I started getting another error in my apache log.
[Sun Dec 18 22:48:27 2011] [error] [client 192.168.1.66] PHP Fatal error: require_once(): Failed opening required 'includes/functions.php' (include_path='.:/usr/share/pear') in /srv/http/zm/index.php on line 97
I also get a blank page when I pull up the zone minder site on my server. I changed the permissions on /usr/share/pear so that everyone has read/write access to this folder. It is currently empty so I don't know if ZM is suppose to have something in there. I restarted apache and zone minder but this hasn't helped. The folder is owned by root along with all other folders in the directory /usr/share. The group is also root.
Any thoughts?
Thank you.
-
- Posts: 13
- Joined: Mon Aug 15, 2011 10:26 pm
Re: Error after clean install.
So last night I too did a clean Arch Linux build and ZoneMinder and it's working fine. I assume your Arch Linux install was akin to this... if not maybe my setup will help:
My ZoneMinder build was something like so:
Make sure Apache is setup correctly
Verify the PHP mysql extension is avaliable. Also, I had to change the short_open_tag to fix a PHP parsing error:
There should be no reason to change the permissions of /usr/share/pear You just need to append the paths to open_basedir this is what mine looks like
As you can see from my configure line I did not build into /srv/http as I will use the httpd-zm.conf file to manage the ZoneMinder web instance.
Quick edit I'm adding the /etc/rc.d/zm script since I cleaned it up yesterday.
Make sure to make it executable
Lastly setup the system startup daemons:
After all that I rebooted and ZoneMinder was good to go!
Note: On my server I have other pages I will be serving. So assuming my server's IP is 192.168.0.2 the URL for ZoneMinder is 192.168.0.2/zm
If you want Apache to bounce you over to ZoneMinder, create an index.html in /srv/html/ with this inside:
Then make sure it has the right owner and permissions:
Code: Select all
# Just after the Arch Linux install: Update the system and reboot
pacman -Syu
pacman -Syu
reboot
# Install required packages
pacman -S \
sudo \
openssh \
lesspipe \
vim \
git \
svn \
x264 \
ffmpeg \
openssl \
apache \
php \
php-apache \
mysql \
libv4l \
gnutls \
libjpeg-turbo \
perl-yaml \
perl-dbi \
perl-dbd-mysql \
perl-getopt-long \
perl-timedate \
perl-time-hires \
perl-date-manip \
perl-libwww \
perl-device-serialport \
perl-mime-tools \
perl-mime-lite \
perl-archive-zip \
perl-net-smtp-ssl
Code: Select all
# Sorry about the [blah] busniess it won't let me post with the url syntax...
cd /usr/src
svn co [http][colon][forward slash][forward slash]svn[dot]zoneminder[dot]com/svn/zm/trunk zm
cd /usr/src/zm
./configure \
--prefix=/usr/lib/zm \
--sysconfdir=/etc/zm \
--with-webhost=localhost \
--with-webuser=http \
--with-webgroup=http \
--with-webdir=/var/lib/zm/www \
--with-cgidir=/var/lib/zm/cgi-bin \
--enable-debug=yes \
--enable-mmap \
ZM_DB_HOST=localhost \
ZM_DB_NAME=zm \
ZM_DB_USER=zmuser \
ZM_DB_PASS=zmpass \
CPPFLAGS="-D__STDC_CONSTANT_MACROS"
# Followed by
make && make install
# Setup the ZoneMinder database and default user
/etc/rc.d/mysqld start
mysql -u root < db/zm_create.sql
mysql -u root -e "grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';"
# Make sure ZoneMinder knows where the cgi lives
mysql --user=zmuser --password=zmpass --host=localhost zm -e "UPDATE Config SET Value='/cgi-zm/nph-zms' WHERE Name='ZM_PATH_ZMS';"
# Install the cambozola
cd /usr/src
wget [http][colon][forward slash][forward slash]www[dot]charliemouse[dot]com:8080/code/cambozola/cambozola-latest.tar.gz
tar -xzvf cambozola-latest.tar.gz
cd $(ls -d */ | grep cambozola)
cp ./dist/cambozola.jar /var/lib/zm/www
chown http:http /var/lib/zm/www/cambozola.jar
Code: Select all
vi /etc/httpd/conf/httpd.conf
# Insert this after LoadModule dir_module modules/mod_dir.so
LoadModule php5_module modules/libphp5.so
# Add these two lines at the end of the "Include" list (or as the last two lines in the file)
Include conf/extra/php5_module.conf
Include conf/extra/httpd-zm.conf
# Uncomment this line
TypesConfig conf/mime.types
# Next setup php as a mime type by adding this line
vi /etc/httpd/conf/mime.types
application/x-httpd-php php php5
Code: Select all
sed -i 's/;extension=mysql.so/extension=mysql.so/' /etc/php/php.ini
sed -i 's/short_open_tag = Off/short_open_tag = On/' /etc/php/php.ini
Code: Select all
vi /etc/php/php.ini
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/etc/zm/:/var/lib/zm/
Code: Select all
vi /etc/httpd/conf/extra/httpd-zm.conf
# /etc/httpd/conf/extra/httpd-zm.conf
# Config for zoneminder web app
Alias /zm "/var/lib/zm/www"
<Directory "/var/lib/zm/www">
Options -Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-zm "/var/lib/zm/cgi-bin"
<Directory "/var/lib/zm/cgi-bin">
AllowOverride All
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
Code: Select all
vi /etc/rc.d/zm
#!/bin/bash
# Source function library.
. /etc/rc.conf
. /etc/rc.d/functions
prog=ZoneMinder
ZM_CONFIG="/etc/zm/zm.conf"
if [ -f $ZM_CONFIG ]; then
. $ZM_CONFIG
command="$ZM_PATH_BIN/zmpkg.pl"
else
stat_busy "$prog Configuration File Not Found: $ZM_CONFIG"
stat_fail
exit 1
fi
start() {
stat_busy "Starting $prog"
$command start
RETVAL=$?
[ $RETVAL = 0 ] && stat_done
[ $RETVAL != 0 ] && stat_fail
return $RETVAL
}
stop() {
stat_busy "Stopping $prog"
$command stop
RETVAL=$?
[ $RETVAL = 0 ] && stat_done
[ $RETVAL != 0 ] && stat_fail
return $RETVAL
}
status() {
result=`$command status`
stat_busy "Checking $prog status"
if [ "$result" = "running" ]; then
status_started
RETVAL=0
else
status_stopped
RETVAL=1
fi
return $RETVAL
}
case "$1" in
'start')
start
;;
'stop')
stop
;;
'restart')
stop
start
;;
'status')
status
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL
Code: Select all
chmod 755 /etc/rc.d/zm
Code: Select all
vi /etc/rc.conf
DAEMONS=(hwclock syslog-ng network netfs crond sshd httpd mysqld zm)
Note: On my server I have other pages I will be serving. So assuming my server's IP is 192.168.0.2 the URL for ZoneMinder is 192.168.0.2/zm
If you want Apache to bounce you over to ZoneMinder, create an index.html in /srv/html/ with this inside:
Code: Select all
vi /srv/html/index.html
<html>
<head>
<meta http-equiv="Refresh" content="0; url=/zm/">
</head>
<body>
<p>This way to <a href="/zm/">ZoneMinder</a>!</p>
</body>
</html>
Code: Select all
chown http:http /srv/html/index.html
chmod 644 /srv/html/index.html
Last edited by humbytheory on Wed Dec 21, 2011 2:13 pm, edited 3 times in total.
Re: Error after clean install.
Thank you for the directions and info. I will give it a try as soon as I can and will report back.
Re: Error after clean install.
Thank you for the help. Things are now working.
I changed a few things from what you had in your directions. With pacman I installed all of the packages you installed, plus in Perl I added a few modules so sftp would work. I don't know that I'll use it, but I added them anyway. I found a post on a different site with a list of things to install.
Specifically I just installed "SFTP" and "Foreign Expect Archive". Some of the others were installed via pacman. I don't think I have everything listed above installed, but I posted the whole thing since I figure it might help someone else.
I also had to install from the latest download version and not SVN. SVN isn't something I'm familiar with and I don't know if there is a difference between what you downloaded and the latest tar.gz file you download from the site, but the SVN gave me all sorts of errors when I tried to compile and the tar.gz download would compile just fine.
The other thing I did different is that I installed the files in /srv/http/zm instead of under /var.
I also left off a few other options,
Here is my ./configure,
I haven't installed cambozola yet, but plan on doing that soon. I only have one camera right now and I'm running on some older hardware but as far as I can tell everything is working pretty well. This morning I noticed a few things that didn't seem to work right but they are minor things so I'm not going to worry about them right now. I'm new to zm so I may have been doing something wrong.
Thank you again for the help.
I changed a few things from what you had in your directions. With pacman I installed all of the packages you installed, plus in Perl I added a few modules so sftp would work. I don't know that I'll use it, but I added them anyway. I found a post on a different site with a list of things to install.
Code: Select all
perl -MCPAN -e shell
install Sys::Mmap Device::SerialPort Net::SFTP::Foreign Expect Archive::Zip MIME::Lite MIME::Entity X10::ActiveHome LWP::UserAgent
quit
I also had to install from the latest download version and not SVN. SVN isn't something I'm familiar with and I don't know if there is a difference between what you downloaded and the latest tar.gz file you download from the site, but the SVN gave me all sorts of errors when I tried to compile and the tar.gz download would compile just fine.
The other thing I did different is that I installed the files in /srv/http/zm instead of under /var.
I also left off a few other options,
Here is my ./configure,
Code: Select all
./configure --with-webhost=localhost --with-webuser=http --with-webgroup=http --with-webdir=/srv/http/zm --with-cgidir=/srv/http/cgi-bin --enable-debug=yes --enable-mmap ZM_DB_HOST=localhost ZM_DB_NAME=zoneminder ZM_DB_USER=[i]db_user[/i] ZM_DB_PASS=[i]db_passwd[/i] CPPFLAGS=-D__STDC_CONSTANT_MACROS
Thank you again for the help.
-
- Posts: 13
- Joined: Mon Aug 15, 2011 10:26 pm
Re: Error after clean install.
Wow, here I was trying to help out and give the exact steps I went through.. and completely forgot I too installed some of the perl modules via cpan. I'm glad you got it going. As for cambozola that's not too hard just download the latest tar ball, unpack and copy the jar file somewhere where Apache can find it and then set the path under:
Options ->Images -> PATH_CAMBOZOLA
Options ->Images -> PATH_CAMBOZOLA
Re: Error after clean install.
No problem. If I can find the time I'm going to install again in a vm so I can document it and put directions in the wiki that someone could hopefully follow top to bottom to install. It's not too tough, but having specific directions is always a good start.
Hope you've had a good new year, and thanks for the help.
Hope you've had a good new year, and thanks for the help.