Last week I published a new version of my ZoneMinder Virtual Appliance. The virtual appliance is great if you want to easily deploy ZoneMinder without having to spend time setting it up. However, in some situations, you want to run ZoneMinder directly on the hardware. Perhaps you need better performance or simply need to capture video streams from V4L-devices.
Since I already spent the time getting it running, I thought I’d share the instructions for getting it running. It’s pretty straight forward, but there are a few minor things that took me some time to get around.
Installation
Optional: I personally prefer to install the do ‘minimal’ version of Ubuntu. You can install this mode by simply hitting F4 right at boot.
Other than the installing the ‘minimal’ system, the only things you would need to keep in mind are to install “LAMP” and “OpenSSH” under the Software selection. You will also need to pick a MySQL password, which will be used later.
Configuration
Upgrade the package repository:
sudo apt-get update && sudo apt-get upgrade
Install all required dependencies:
sudo apt-get install build-essential ffmpeg libmysqlclient-dev libjpeg-dev libssl-dev libdate-manip-perl wget liblwp-useragent-determined-perl libavformat-dev libphp-serialization-perl libswscale-dev joe
Get Zoneminder:
wget http://www.zoneminder.com/downloads/ZoneMinder-1.24.2.tar.gz
Extract Zoneminder and change permission:
sudo tar xvfz ZoneMinder-1.24.2.tar.gz -C /usr/local/
sudo chown -R `whoami` /usr/local/ZoneMinder-1.24.2
Configure Zoneminder:
cd /usr/local/ZoneMinder-1.24.2
./configure --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin/ --with-webuser=www-data --with-webgroup=www-data ZM_DB_USER=zm ZM_DB_NAME=zm ZM_DB_PASS=yourpassword ZM_SSL_LIB=openssl
Resolve a bug (discussed more here):
joe src/zm_utils.cpp (or your favorite editor)
Add the line ‘#include
Build and install Zoneminder
make
sudo make install
Configure the database:
mysql -uroot -p < db/zm_create.sql
echo "GRANT ALL PRIVILEGES ON zm.* TO 'zm'@'localhost' IDENTIFIED BY 'yourpassword'; FLUSH PRIVILEGES;" | mysql -uroot -p
Install Cambozola:
cd
wget http://www.charliemouse.com:8080/code/cambozola/cambozola-latest.tar.gz
tar xvfz cambozola-latest.tar.gz
sudo cp cambozola-0.76/dist/cambozola.jar /var/www/zm/
Make Zoneminder the root-page in Apache:
sudo joe /etc/apache2/sites-enabled/000-default
Change “DocumentRoot /var/www” to “DocumentRoot /var/www/zm” and “Directory /var/www/” to “Directory /var/www/zm/”
Restart Apache:
sudo /etc/init.d/apache2 restart
Change some system parameters:
sudo sysctl kernel.shmall=134217728
sudo sysctl kernel.shmmax=134217728
Make the system parameters permanent:
sudo joe /etc/sysctl.conf
Add the following lines at the end:
kernel.shmall=134217728
kernel.shmmax=134217728
Install the startup-script (from the official site):
sudo wget http://viktorpetersson.com/upload/zm -O /etc/init.d/zm
sudo chmod +x /etc/init.d/zm
sudo update-rc.d zm defaults
sudo /etc/init.d/zm start
That’s it. You should now have a fully working version of ZoneMinder. All you need to do now is to point your browser to the IP address of the server.
Tags: Linux, Ubuntu, ZoneMinder
-
Dave
-
Boga
-
Saint
-
Saint
-
Anonymous
-
Tavo Tell
-
Anonymous
-
Spy


