Debian 12: Difference between revisions

From VoIPmonitor.org
(Created page with " = Install MariaDB= 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...")
 
(Review: pridán hlavní nadpis, diagram architektury, opravena SQL syntaxe, vylepšeno formátování)
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
= VoIPmonitor Installation on Debian 12 =


This guide describes the installation of VoIPmonitor on '''Debian 12 (Bookworm)''' with PHP 8.2. The installation consists of three main components: MariaDB database, Web GUI, and the Sensor (sniffer).


= Install MariaDB=
<kroki lang="mermaid">
apt-get -y install mariadb-server
%%{init: {'flowchart': {'nodeSpacing': 15, 'rankSpacing': 40}}}%%
flowchart LR
    subgraph Server["Debian 12 Server"]
        DB[(MariaDB)]
        GUI[Web GUI<br/>PHP 8.2]
        Sensor[Sensor]
    end
    GUI --> DB
    Sensor --> DB
    Net[Network Traffic] --> Sensor
    Browser[Browser] --> GUI
</kroki>


== change auth method for root@localhost user from unix_socket to mysql_native_password type with no password==
== Prerequisites ==
Start the mysql console first with '''mysql''' and push following queries:
* Fresh Debian 12 installation
MariaDB> ALTER USER root@localhost IDENTIFIED VIA mysql_native_password;
* Root access
MariaDB> SET PASSWORD = PASSWORD("");
* Internet connectivity
MariaDB> FLUSH PRIVILEGES;
* MariaDB 11.4 or later (Debian 12 ships with MariaDB) - Fully supported, tested with MariaDB 11.8


==Set mariadb's config==
== MariaDB Installation ==
in /etc/mysql/mariadb.conf.d/50-server.cnf edit [mysqld] section and add options, like suggested in [[scaling https://www.voipmonitor.org/doc/Scaling#MySQL_performance]] 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
innodb_read_only_compressed=OFF


==Restart mariadb service==
'''1. Install MariaDB server:'''
service mariadb restart
<syntaxhighlight lang="bash">
==create database needed for voipmonitor==
apt-get update
mysqladmin create voipmonitor
apt-get -y install mariadb-server
</syntaxhighlight>


=Install voipmonitor sensor=
'''2. Configure root authentication:'''
==Installing sensor - voipmonitor service==
mkdir /usr/src/voipmonitor
cd /usr/src/voipmonitor
wget --content-disposition http://www.voipmonitor.org/current-stable-sniffer-static-64bit.tar.gz -O x.tar.gz
tar xzf x.tar.gz
cd voipmonitor-*
./install-script.sh --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=
Change the authentication method for root@localhost from unix_socket to mysql_native_password:
==Installation of packages needed by voipmonitor's GUI==
<syntaxhighlight lang="bash">
apt-get install php php-gd php-mysql php-cli libapache2-mod-php php-mbstring php-zip tshark mtr librsvg2-bin gsfonts rrdtool libtiff-tools
mysql
(When asked if non-superuser can capture traffic You can answer No)
</syntaxhighlight>


==downgrade php to 8.1==
<syntaxhighlight lang="sql">
Unfortunately php 8.2 is not supported by ioncube loader yet, you need to downgrade the php to version 8.1 using sury apt repositories
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password;
apt update
SET PASSWORD = PASSWORD("");
apt -y install apt-transport-https lsb-release ca-certificates curl wget gnupg2
FLUSH PRIVILEGES;
exit
</syntaxhighlight>


wget -qO- https://packages.sury.org/php/apt.gpg | \
'''3. Configure MariaDB for performance:'''
gpg --dearmor > /etc/apt/trusted.gpg.d/sury-php-x.x.gpg


sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" \
Edit <code>/etc/mysql/mariadb.conf.d/50-server.cnf</code> and add these options to the <code>[mysqld]</code> section. See the [[Scaling#MySQL_performance|scaling guide]] for more details.
> /etc/apt/sources.list.d/php.list'
<syntaxhighlight lang="ini">
innodb_flush_log_at_trx_commit = 2
innodb_file_format = barracuda
innodb_buffer_pool_size = 8GB
innodb_read_only_compressed = OFF
</syntaxhighlight>


apt update
{{Note|1=Set <code>innodb_buffer_pool_size</code> to approximately half of your available RAM. <code>innodb_read_only_compressed = OFF</code> is required starting from MariaDB 10.6.}}
apt install php8.1 php8.1-gd php8.1-mysql php8.1-cli php8.1-mbstring php8.1-zip libapache2-mod-php8.1


update-alternatives --list php
'''4. Apply changes and create database:'''
update-alternatives --set php /usr/bin/php8.1
<syntaxhighlight lang="bash">
a2dismod php8.2
systemctl restart mariadb
a2enmod php8.1
mysqladmin create voipmonitor
</syntaxhighlight>
==Installing IOncube - php loader / decryptor==
wget --no-continue http://voipmonitor.org/ioncube/x86_64/ioncube_loader_lin_8.1.so -O /usr/lib/php/8.1/ioncube_loader_lin_8.1.so
echo "zend_extension = /usr/lib/php/8.1/ioncube_loader_lin_8.1.so" > /etc/php/8.1/mods-available/ioncube.ini
ln -s /etc/php/8.1/mods-available/ioncube.ini /etc/php/8.1/apache2/conf.d/01-ioncube.ini
ln -s /etc/php/8.1/mods-available/ioncube.ini /etc/php/8.1/cli/conf.d/01-ioncube.ini


==Installing package for voipmonitor GUI==
== Web GUI Installation ==
cd /var/www/html
rm -f index.html
wget "http://www.voipmonitor.org/download-gui?version=latest&major=5&phpver=82&festry" -O w.tar.gz
tar xzf w.tar.gz
mv voipmonitor-gui*/* ./


==Finalizing steps==
'''1. Install required packages:'''
For working alerts / reports, system needs to run periodicaly script using scheduller
<syntaxhighlight lang="bash">
echo " * * * * * root php /var/www/html/php/run.php cron" >> /etc/crontab
apt-get install php php-gd php-mysql php-cli php-curl libapache2-mod-php php-mbstring php-zip tshark mtr librsvg2-bin fonts-urw-base35 rrdtool libtiff-tools wget
kill -HUP `pgrep cron`
</syntaxhighlight>


Set privileges for apache
When asked if non-superusers can capture traffic, answer '''No'''.
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=
'''2. Install PHP 8.2 packages:'''
systemctl enable voipmonitor
<syntaxhighlight lang="bash">
/etc/init.d/voipmonitor start
apt-get install php8.2 php8.2-gd php8.2-mysql php8.2-cli php8.2-mbstring php8.2-zip libapache2-mod-php8.2
</syntaxhighlight>


=Binaries downloaded with first access of the GUI (voluntary)=
'''3. Install IonCube loader:'''
You can speedup the installation process by downloading and installing binaries the GUI needs with following steps for 64bits only.
​wget http://sourceforge.net/projects/voipmonitor/files/wkhtml/phantomjs-2.1.1-x86_64.gz/download -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 http://sourceforge.net/projects/voipmonitor/files/wkhtml/sox-x86_64.gz/download -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 http://sourceforge.net/projects/voipmonitor/files/wkhtml/tshark-2.3.0.3-x86_64.gz/download -O '/var/www/html/bin/tshark-2.3.0.3-x86_64.gz'
gunzip '/var/www/html/bin/tshark-2.3.0.3-x86_64.gz'
chmod +x '/var/www/html/bin/tshark-2.3.0.3-x86_64'
wget http://sourceforge.net/projects/voipmonitor/files/wkhtml/mergecap-2.3.0.3-x86_64.gz/download -O '/var/www/html/bin/mergecap-2.3.0.3-x86_64.gz'
gunzip '/var/www/html/bin/mergecap-2.3.0.3-x86_64.gz'
chmod +x '/var/www/html/bin/mergecap-2.3.0.3-x86_64'
wget http://sourceforge.net/projects/voipmonitor/files/wkhtml/t38_decode-2-i686.gz/download -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)=
IonCube is required for the encrypted PHP files in the GUI.
Following describes how to build and install custom voipmonitor binary from sources (tested with sniffer sources version 31.7.5)
<syntaxhighlight lang="bash">
wget --no-continue http://voipmonitor.org/ioncube/x86_64/ioncube_loader_lin_8.2.so -O /usr/lib/php/8.2/ioncube_loader_lin_8.2.so
echo "zend_extension = /usr/lib/php/8.2/ioncube_loader_lin_8.2.so" > /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
</syntaxhighlight>


==First install necesary develop packages==
'''4. Download and install GUI:'''
​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
<syntaxhighlight lang="bash">
cd /var/www/html
rm -f index.html
wget "http://www.voipmonitor.org/download-gui?version=latest&major=5&allowed&phpver=82" -O w.tar.gz
tar xzf w.tar.gz
mv voipmonitor-gui*/* ./
</syntaxhighlight>


==Then download voipmonitor sources and build==
'''5. Configure cron and permissions:'''
mkdir /usr/src/voipmonitor-git
<syntaxhighlight lang="bash">
cd /usr/src/voipmonitor-git
echo "* * * * * root php /var/www/html/php/run.php cron" >> /etc/crontab
git clone https://github.com/voipmonitor/sniffer.git ./
kill -HUP $(pgrep cron)
cd sniffer
chown -R www-data /var/www/html
./configure
mkdir -p /var/spool/voipmonitor/
make
chown www-data /var/spool/voipmonitor/
​make install
systemctl restart apache2
</syntaxhighlight>
 
== Sensor Installation ==
 
'''1. Download and install sensor:'''
<syntaxhighlight lang="bash">
mkdir /usr/src/voipmonitor
cd /usr/src/voipmonitor
wget --content-disposition http://www.voipmonitor.org/current-stable-sniffer-static-64bit.tar.gz -O x.tar.gz
tar xzf x.tar.gz
cd voipmonitor-*
./install-script.sh --no-user-input
</syntaxhighlight>
 
'''2. Configure sensor:'''
 
Edit <code>/etc/voipmonitor.conf</code> and set at minimum:
<syntaxhighlight lang="ini">
interface = eth0
spooldir = /var/spool/voipmonitor
cleandatabase = 31
sipport = 5060
maxpoolsize = 102400
</syntaxhighlight>
 
{{Note|1=Replace <code>eth0</code> with your actual network interface name (e.g., <code>ens33</code>). Use <code>ip link</code> to list available interfaces.}}
 
'''3. Start and enable sensor:'''
<syntaxhighlight lang="bash">
systemctl start voipmonitor
systemctl enable voipmonitor
</syntaxhighlight>
 
== Finish Installation ==
 
Open your browser and navigate to <code>http://your-server-ip/</code> to complete the web-based setup wizard.
 
== Optional: Pre-download GUI Binaries ==
 
You can speed up the installation by pre-downloading binaries the GUI needs:
<syntaxhighlight lang="bash">
wget http://sourceforge.net/projects/voipmonitor/files/wkhtml/phantomjs-2.1.1-x86_64.gz/download -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 http://sourceforge.net/projects/voipmonitor/files/wkhtml/sox-x86_64.gz/download -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'
</syntaxhighlight>
 
== Optional: Building from Source ==
 
To build the sensor from source code:
 
'''1. Install build dependencies:'''
<syntaxhighlight lang="bash">
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
</syntaxhighlight>
 
'''2. Clone and build:'''
<syntaxhighlight lang="bash">
mkdir /usr/src/voipmonitor-git
cd /usr/src/voipmonitor-git
git clone https://github.com/voipmonitor/sniffer.git ./
./configure
make
make install
</syntaxhighlight>
 
== AI Summary for RAG ==
'''Summary:''' Complete installation guide for VoIPmonitor on Debian 12 (Bookworm). Covers three main components: MariaDB database setup (version 11.4+ supported, tested with 11.8), Web GUI installation with PHP 8.2 and IonCube loader, and Sensor (sniffer) installation using static binary package. Includes performance tuning for MariaDB (innodb_buffer_pool_size, innodb_flush_log_at_trx_commit), optional steps for pre-downloading GUI binaries (phantomjs, sox), and instructions for building from source.
 
'''Keywords:''' Debian 12, Bookworm, MariaDB 11.4, MariaDB 11.8, installation, sensor, sniffer, GUI, PHP 8.2, IonCube, Apache2, innodb_buffer_pool_size, innodb_read_only_compressed, static binary, build from source
 
'''Key Questions:'''
* How to install VoIPmonitor on Debian 12 Bookworm?
* Which MariaDB version is supported on Debian 12?
* Is MariaDB 11.4 or 11.8 compatible with VoIPmonitor?
* What are the prerequisites for VoIPmonitor on Debian 12?
* How to configure MariaDB for VoIPmonitor on Debian?
* How to install IonCube loader for PHP 8.2 on Debian 12?
* How to build VoIPmonitor sensor from source on Debian 12?
 
== See Also ==
* [[Scaling]] - Performance tuning
* [[Sniffer_configuration]] - Full configuration reference
* [[GUI_installation]] - Detailed GUI setup
* [[Rocky_9]] - Installation on Rocky Linux 9

Latest revision as of 18:00, 6 January 2026

VoIPmonitor Installation on Debian 12

This guide describes the installation of VoIPmonitor on Debian 12 (Bookworm) with PHP 8.2. The installation consists of three main components: MariaDB database, Web GUI, and the Sensor (sniffer).

Prerequisites

  • Fresh Debian 12 installation
  • Root access
  • Internet connectivity
  • MariaDB 11.4 or later (Debian 12 ships with MariaDB) - Fully supported, tested with MariaDB 11.8

MariaDB Installation

1. Install MariaDB server:

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

2. Configure root authentication:

Change the authentication method for root@localhost from unix_socket to mysql_native_password:

mysql
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password;
SET PASSWORD = PASSWORD("");
FLUSH PRIVILEGES;
exit

3. Configure MariaDB for performance:

Edit /etc/mysql/mariadb.conf.d/50-server.cnf and add these options to the [mysqld] section. See the scaling guide for more details.

innodb_flush_log_at_trx_commit = 2
innodb_file_format = barracuda
innodb_buffer_pool_size = 8GB
innodb_read_only_compressed = OFF

ℹ️ Note: Set innodb_buffer_pool_size to approximately half of your available RAM. innodb_read_only_compressed = OFF is required starting from MariaDB 10.6.

4. Apply changes and create database:

systemctl restart mariadb
mysqladmin create voipmonitor

Web GUI Installation

1. Install required packages:

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

When asked if non-superusers can capture traffic, answer No.

2. Install PHP 8.2 packages:

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

3. Install IonCube loader:

IonCube is required for the encrypted PHP files in the GUI.

wget --no-continue http://voipmonitor.org/ioncube/x86_64/ioncube_loader_lin_8.2.so -O /usr/lib/php/8.2/ioncube_loader_lin_8.2.so
echo "zend_extension = /usr/lib/php/8.2/ioncube_loader_lin_8.2.so" > /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

4. Download and install GUI:

cd /var/www/html
rm -f index.html
wget "http://www.voipmonitor.org/download-gui?version=latest&major=5&allowed&phpver=82" -O w.tar.gz
tar xzf w.tar.gz
mv voipmonitor-gui*/* ./

5. Configure cron and permissions:

echo "* * * * * root php /var/www/html/php/run.php cron" >> /etc/crontab
kill -HUP $(pgrep cron)
chown -R www-data /var/www/html
mkdir -p /var/spool/voipmonitor/
chown www-data /var/spool/voipmonitor/
systemctl restart apache2

Sensor Installation

1. Download and install sensor:

mkdir /usr/src/voipmonitor
cd /usr/src/voipmonitor
wget --content-disposition http://www.voipmonitor.org/current-stable-sniffer-static-64bit.tar.gz -O x.tar.gz
tar xzf x.tar.gz
cd voipmonitor-*
./install-script.sh --no-user-input

2. Configure sensor:

Edit /etc/voipmonitor.conf and set at minimum:

interface = eth0
spooldir = /var/spool/voipmonitor
cleandatabase = 31
sipport = 5060
maxpoolsize = 102400

ℹ️ Note: Replace eth0 with your actual network interface name (e.g., ens33). Use ip link to list available interfaces.

3. Start and enable sensor:

systemctl start voipmonitor
systemctl enable voipmonitor

Finish Installation

Open your browser and navigate to http://your-server-ip/ to complete the web-based setup wizard.

Optional: Pre-download GUI Binaries

You can speed up the installation by pre-downloading binaries the GUI needs:

wget http://sourceforge.net/projects/voipmonitor/files/wkhtml/phantomjs-2.1.1-x86_64.gz/download -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 http://sourceforge.net/projects/voipmonitor/files/wkhtml/sox-x86_64.gz/download -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'

Optional: Building from Source

To build the sensor from source code:

1. Install build dependencies:

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

2. Clone and build:

mkdir /usr/src/voipmonitor-git
cd /usr/src/voipmonitor-git
git clone https://github.com/voipmonitor/sniffer.git ./
./configure
make
make install

AI Summary for RAG

Summary: Complete installation guide for VoIPmonitor on Debian 12 (Bookworm). Covers three main components: MariaDB database setup (version 11.4+ supported, tested with 11.8), Web GUI installation with PHP 8.2 and IonCube loader, and Sensor (sniffer) installation using static binary package. Includes performance tuning for MariaDB (innodb_buffer_pool_size, innodb_flush_log_at_trx_commit), optional steps for pre-downloading GUI binaries (phantomjs, sox), and instructions for building from source.

Keywords: Debian 12, Bookworm, MariaDB 11.4, MariaDB 11.8, installation, sensor, sniffer, GUI, PHP 8.2, IonCube, Apache2, innodb_buffer_pool_size, innodb_read_only_compressed, static binary, build from source

Key Questions:

  • How to install VoIPmonitor on Debian 12 Bookworm?
  • Which MariaDB version is supported on Debian 12?
  • Is MariaDB 11.4 or 11.8 compatible with VoIPmonitor?
  • What are the prerequisites for VoIPmonitor on Debian 12?
  • How to configure MariaDB for VoIPmonitor on Debian?
  • How to install IonCube loader for PHP 8.2 on Debian 12?
  • How to build VoIPmonitor sensor from source on Debian 12?

See Also