Rocky 9: Difference between revisions

From VoIPmonitor.org
(Restructure: reduce excessive headings, use numbered steps)
 
Line 1: Line 1:
This guide describes the installation of VoIPmonitor on '''Rocky Linux 9''' with PHP 8.2 and MySQL 8.0. The installation consists of three main components: MySQL database, Web GUI, and the Sensor (sniffer).


='''Installation procedure'''=
== Prerequisites ==
* Fresh Rocky Linux 9 installation
* Root access
* Internet connectivity


==GUI==
== MySQL Installation ==
===Upgrade php's version to 8.2===
(there is no ioncube for php8.0)


'''1. Install MySQL server:'''
dnf install mysql-server
'''2. Configure MySQL:'''
Edit <code>/etc/my.cnf.d/mysql-server.cnf</code> and add:
default-authentication-plugin = mysql_native_password
innodb_flush_log_at_trx_commit = 2
innodb_buffer_pool_size = 8GB
skip-log-bin
{{Note|Set <code>innodb_buffer_pool_size</code> to approximately half of your available RAM. See the [[Scaling]] guide for more details.}}
'''3. Start MySQL and configure authentication:'''
systemctl start mysqld
systemctl enable mysqld
Change root password to empty (or set <code>mysqlpassword</code> in <code>/etc/voipmonitor.conf</code> later):
mysql
mysql> ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY '';
mysql> FLUSH PRIVILEGES;
mysql> exit
'''4. Run security configuration:'''
mysql_secure_installation
== Web GUI Installation ==
'''1. Enable PHP 8.2 from Remi repository:'''
Rocky 9 ships with PHP 8.0, but IonCube requires PHP 8.2:
  dnf install epel-release
  dnf install epel-release
  dnf install http://rpms.remirepo.net/enterprise/remi-release-9.rpm
  dnf install http://rpms.remirepo.net/enterprise/remi-release-9.rpm
dnf install dnf-utils
dnf update
  dnf module reset php
  dnf module reset php
  dnf module install php:remi-8.2
  dnf module install php:remi-8.2


===Install necessary packages for GUI operations===
'''2. Install required packages:'''
  dnf install wget httpd wireshark php php-gd php-mysqlnd php-mbstring php-zip mtr php-process librsvg2 librsvg2-tools urw-fonts
  dnf install wget httpd wireshark php php-gd php-mysqlnd php-mbstring php-zip mtr php-process librsvg2 librsvg2-tools urw-fonts


===Install ioncube module for httpd and disable SE linux===
'''3. Install IonCube loader:'''
  wget http://voipmonitor.org/ioncube/x86_64/ioncube_loader_lin_8.2.so -O /usr/lib64/php/modules/ioncube_loader_lin_8.2.so
  wget http://voipmonitor.org/ioncube/x86_64/ioncube_loader_lin_8.2.so -O /usr/lib64/php/modules/ioncube_loader_lin_8.2.so
  echo "zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_8.2.so" > /etc/php.d/01_ioncube.ini
  echo "zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_8.2.so" > /etc/php.d/01_ioncube.ini
chown -R apache /var/www/html
 
'''4. Disable SELinux:'''
 
SELinux must be disabled for VoIPmonitor to function properly:
  sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  setenforce 0
  setenforce 0
systemctl restart httpd.service


===GUI's package installation===
'''5. Download and install GUI:'''
  cd /var/www/html  
  cd /var/www/html
  wget "http://www.voipmonitor.org/download-gui?version=latest&major=5&allowed&phpver=82" -O w.tar.gz
  wget "http://www.voipmonitor.org/download-gui?version=latest&major=5&phpver=82" -O w.tar.gz
  tar xzf w.tar.gz  
  tar xzf w.tar.gz
  mv voipmonitor-gui*/* ./
  mv voipmonitor-gui*/* ./
chown apache /var/spool/voipmonitor/
chown apache -R /var/www/html


==Database Mysql 8.0==
'''6. Configure permissions and start Apache:'''
 
chown -R apache /var/www/html
===Install===
mkdir -p /var/spool/voipmonitor
  dnf install mysql-server
  chown apache /var/spool/voipmonitor
systemctl start httpd
systemctl enable httpd


===Set up===
'''7. Configure cron for alerts and reports:'''
====set the service====
echo "* * * * * root php /var/www/html/php/run.php cron" >> /etc/crontab
(set there up to half of available RAM for innodb_buffer_pool_size, read more in [[scaling]] section of our doc)
kill -HUP $(pgrep crond)
  echo 'default-authentication-plugin=mysql_native_password' >> /etc/my.cnf.d/mysql-server.cnf
  echo 'innodb_flush_log_at_trx_commit = 2' >> /etc/my.cnf.d/mysql-server.cnf
  echo 'innodb_buffer_pool_size = 8GB' >> /etc/my.cnf.d/mysql-server.cnf
  echo 'skip-log-bin' >> /etc/my.cnf.d/mysql-server.cnf


====change auth plugin====
{{Note|Install an MTA (mail transfer agent) if you need email notifications.}}
You need to change the root@localhost's password to none, otherwise you will need to set mysqlpassword option in /etc/voipmonitor.conf)
Start and Login to mysql and run queries:
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY ''''''';
FLUSH PRIVILEGES;


==Activating web and db services==
== Sensor Installation ==
systemctl start httpd.service
systemctl enable httpd.service
systemctl start mysqld.service
systemctl enable mysqld.service
mysql_secure_installation


=== Activate alerts/reports/license updates ===
'''1. Create systemd service file:'''
echo " * * * * * root php /var/www/html/php/run.php cron" >> /etc/crontab
kill -HUP `pgrep cron`
Don't forget to install the MTA to make possible to send the email with php's email functions.
(make possible to send the emails via the CLI)


==Install voipmonitor's sniffer service==
Create <code>/etc/systemd/system/voipmonitor.service</code> - see [[systemd for voipmonitor service management]] for the template.
===Prepare service file===
(It is used by systemd to control service's states)


Please, get a service file [[systemd for voipmonitor service management|here]]
'''2. Download and install sensor:'''
vim /etc/systemd/system/voipmonitor.service
  cd /usr/local/src
 
  wget --content-disposition http://www.voipmonitor.org/current-stable-sniffer-static-64bit.tar.gz -O current-stable-sniffer-static-64bit.tar.gz
===Install the service's binary===
  cd /usr/local/src/
  wget --content-disposition http://www.voipmonitor.org/current-stable-sniffer-static-64bit.tar.gz -O ./current-stable-sniffer-static-64bit.tar.gz
  tar xzf current-stable-sniffer-static-64bit.tar.gz
  tar xzf current-stable-sniffer-static-64bit.tar.gz
  cd `dirname \`find . |grep install-script\``
  cd voipmonitor-*
  mkdir /etc/init.d
  mkdir -p /etc/init.d
  ./install-script.sh --no-user-input
  ./install-script.sh --no-user-input
#at least set interface option in configuration file
#vim /etc/voipmonitor.conf
systemctl daemon-reload
systemctl restart voipmonitor.service
systemctl enable voipmonitor.service
=Firewalld=
==Allow your IP to reach http of the GUI==
iptables -I INPUT -s YOUR_IP -j ACCEPT
==stop firewalld service==
systemctl stop firewalld
==disable firewalld service==
(not loads at host bootup
systemctl disable firewalld


'''3. Configure sensor:'''


Edit <code>/etc/voipmonitor.conf</code> and set at minimum:
interface = eth0
spooldir = /var/spool/voipmonitor
cleandatabase = 31
sipport = 5060
maxpoolsize = 102400


{{Note|Replace <code>eth0</code> with your actual network interface name.}}


'''4. Start and enable sensor:'''
systemctl daemon-reload
systemctl start voipmonitor
systemctl enable voipmonitor


== Firewall Configuration ==


'''Option 1: Allow specific IP access:'''
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="YOUR_IP" accept'
firewall-cmd --reload


'''Option 2: Open HTTP port:'''
firewall-cmd --permanent --add-service=http
firewall-cmd --reload


'''Option 3: Disable firewall (not recommended for production):'''
systemctl stop firewalld
systemctl disable firewalld


== Finish Installation ==


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


Now go to http://yourserver/ and finish the installation.
== See Also ==
* [[Scaling]] - Performance tuning
* [[Configuration_file]] - Full configuration reference
* [[systemd for voipmonitor service management]] - Systemd service file

Latest revision as of 22:49, 11 December 2025

This guide describes the installation of VoIPmonitor on Rocky Linux 9 with PHP 8.2 and MySQL 8.0. The installation consists of three main components: MySQL database, Web GUI, and the Sensor (sniffer).

Prerequisites

  • Fresh Rocky Linux 9 installation
  • Root access
  • Internet connectivity

MySQL Installation

1. Install MySQL server:

dnf install mysql-server

2. Configure MySQL:

Edit /etc/my.cnf.d/mysql-server.cnf and add:

default-authentication-plugin = mysql_native_password
innodb_flush_log_at_trx_commit = 2
innodb_buffer_pool_size = 8GB
skip-log-bin

Template:Note

3. Start MySQL and configure authentication:

systemctl start mysqld
systemctl enable mysqld

Change root password to empty (or set mysqlpassword in /etc/voipmonitor.conf later):

mysql
mysql> ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY ;
mysql> FLUSH PRIVILEGES;
mysql> exit

4. Run security configuration:

mysql_secure_installation

Web GUI Installation

1. Enable PHP 8.2 from Remi repository:

Rocky 9 ships with PHP 8.0, but IonCube requires PHP 8.2:

dnf install epel-release
dnf install http://rpms.remirepo.net/enterprise/remi-release-9.rpm
dnf module reset php
dnf module install php:remi-8.2

2. Install required packages:

dnf install wget httpd wireshark php php-gd php-mysqlnd php-mbstring php-zip mtr php-process librsvg2 librsvg2-tools urw-fonts

3. Install IonCube loader:

wget http://voipmonitor.org/ioncube/x86_64/ioncube_loader_lin_8.2.so -O /usr/lib64/php/modules/ioncube_loader_lin_8.2.so
echo "zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_8.2.so" > /etc/php.d/01_ioncube.ini

4. Disable SELinux:

SELinux must be disabled for VoIPmonitor to function properly:

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0

5. Download and install GUI:

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

6. Configure permissions and start Apache:

chown -R apache /var/www/html
mkdir -p /var/spool/voipmonitor
chown apache /var/spool/voipmonitor
systemctl start httpd
systemctl enable httpd

7. Configure cron for alerts and reports:

echo "* * * * * root php /var/www/html/php/run.php cron" >> /etc/crontab
kill -HUP $(pgrep crond)

Template:Note

Sensor Installation

1. Create systemd service file:

Create /etc/systemd/system/voipmonitor.service - see systemd for voipmonitor service management for the template.

2. Download and install sensor:

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

3. Configure sensor:

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

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

Template:Note

4. Start and enable sensor:

systemctl daemon-reload
systemctl start voipmonitor
systemctl enable voipmonitor

Firewall Configuration

Option 1: Allow specific IP access:

firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="YOUR_IP" accept'
firewall-cmd --reload

Option 2: Open HTTP port:

firewall-cmd --permanent --add-service=http
firewall-cmd --reload

Option 3: Disable firewall (not recommended for production):

systemctl stop firewalld
systemctl disable firewalld

Finish Installation

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

See Also