Debian 12

Jump to navigation Jump to search

Install MariaDB

apt-get update
apt-get -y install mariadb-server

change auth method for root@localhost user from unix_socket to mysql_native_password type with no password

Start the mysql console first with mysql and push following queries:

MariaDB> ALTER USER root@localhost IDENTIFIED VIA mysql_native_password;

Set mariadb's config

in /etc/mysql/mariadb.conf.d/50-server.cnf edit [mysqld] section and add options, like suggested in scalling section fo our doc

innodb_flush_log_at_trx_commit = 2
innodb_file_format = barracuda
#set there up to half of available mem
innodb_buffer_pool_size = 8GB
#starting from mariadb 10.6 is necesasry to disable read-only for compressed tables

Restart mariadb service

systemctl restart mariadb

create database needed for voipmonitor

mysqladmin create voipmonitor

Install voipmonitor sensor

Installing sensor - voipmonitor service

mkdir /usr/src/voipmonitor
cd /usr/src/voipmonitor
wget --content-disposition -O x.tar.gz
tar xzf x.tar.gz
cd voipmonitor-*
./ --no-user-input
#set in /etc/voipmonitor.conf at least interface option it can be like interface=ens33, spooldir=/var/spool/voipmonitor, cleandatabase=31, sipport=5060, maxpoolsize=102400

Install voipmonitor GUI

Installation of packages needed by voipmonitor's GUI

apt-get install php php-gd php-mysql php-cli libapache2-mod-php php-mbstring php-zip tshark mtr librsvg2-bin fonts-urw-base35 rrdtool libtiff-tools wget

(When asked if non-superuser can capture traffic You can answer No)

php 8.2 and packages

apt update
apt install php8.2 php8.2-gd php8.2-mysql php8.2-cli php8.2-mbstring php8.2-zip libapache2-mod-php8.2

Installing IOncube - php loader / decryptor

wget --no-continue -O /usr/lib/php/8.2/
echo "zend_extension = /usr/lib/php/8.2/" > /etc/php/8.2/mods-available/ioncube.ini
ln -s /etc/php/8.2/mods-available/ioncube.ini /etc/php/8.2/apache2/conf.d/01-ioncube.ini
ln -s /etc/php/8.2/mods-available/ioncube.ini /etc/php/8.2/cli/conf.d/01-ioncube.ini

Installing package for voipmonitor GUI

cd /var/www/html
rm -f index.html 
wget "" -O w.tar.gz
tar xzf w.tar.gz
mv voipmonitor-gui*/* ./

Finalizing steps

For working alerts / reports, system needs to run periodicaly script using scheduller

echo " * * * * * root php /var/www/html/php/run.php cron" >> /etc/crontab
kill -HUP `pgrep cron`

Set privileges for apache

chown -R www-data /var/www/html
/etc/init.d/apache2 restart
chown www-data /var/spool/voipmonitor/

set service to be started at a boot time

systemctl enable voipmonitor
/etc/init.d/voipmonitor start

Binaries downloaded with first access of the GUI (voluntary)

You can speedup the installation process by downloading and installing binaries the GUI needs with following steps for 64bits only.

​wget -O '/var/www/html/bin/phantomjs-2.1.1-x86_64.gz'
gunzip '/var/www/html/bin/phantomjs-2.1.1-x86_64.gz'
chmod +x '/var/www/html/bin/phantomjs-2.1.1-x86_64'
wget -O '/var/www/html/bin/sox-x86_64.gz'
gunzip '/var/www/html/bin/sox-x86_64.gz'
chmod +x '/var/www/html/bin/sox-x86_64'
wget -O '/var/www/html/bin/tshark-'
gunzip '/var/www/html/bin/tshark-'
chmod +x '/var/www/html/bin/tshark-'
wget -O '/var/www/html/bin/mergecap-'
gunzip '/var/www/html/bin/mergecap-'
chmod +x '/var/www/html/bin/mergecap-'
wget -O '/var/www/html/bin/t38_decode-2-i686.gz'
gunzip '/var/www/html/bin/t38_decode-2-i686.gz'
chmod +x '/var/www/html/bin/t38_decode-2-i686'

Building service's binary file from sources (voluntary)

Following describes how to build and install custom voipmonitor binary from sources (tested with sniffer sources version 31.7.5)

First install necesary develop packages

​apt-get -y install git build-essential unixodbc-dev libvorbis-dev libpcap-dev libsnappy-dev libcurl4-openssl-dev libicu-dev libjson-c-dev libssh-dev librrd-dev libglib2.0-dev libxml2-dev libfftw3-dev liblzma-dev liblzo2-dev libpng-dev libgcrypt-dev libgoogle-perftools-dev libmariadb-dev libmariadb-dev-compat

Then download voipmonitor sources and build

mkdir /usr/src/voipmonitor-git
cd /usr/src/voipmonitor-git
git clone ./
cd sniffer
​make install