Rocky 9: Difference between revisions

From VoIPmonitor.org
No edit summary
(Review: odstranění nerelevantního obsahu (anti-fraud), opravy formátování (přidán [mysqld] header, opravena syntaxe SQL, přidán mysqladmin create), vylepšení AI Summary)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Rocky Linux 9 Installation Guide =


='''Installation procedure'''=
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).


==GUI==
== Prerequisites ==
===Upgrade php's version to 8.2===
* Fresh Rocky Linux 9 installation
(there is no ioncube for php8.0)
* Root access
* Internet connectivity


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


===Install necessary packages for GUI operations including db===
'''1. Install MySQL server:'''
dnf install wget httpd wireshark php php-gd php-mysqlnd php-mbstring php-zip mtr php-process librsvg2 librsvg2-tools urw-fonts mysql-server


===Install ioncube module for httpd and disable SE linux===
<syntaxhighlight lang="bash">
wget http://voipmonitor.org/ioncube/x86_64/ioncube_loader_lin_8.2.so -O /usr/lib64/php/modules/ioncube_loader_lin_8.2.so
dnf install mysql-server
echo "zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_8.2.so" > /etc/php.d/01_ioncube.ini
</syntaxhighlight>
chown -R apache /var/www/html
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0
systemctl restart httpd.service


===GUI's package installation===
'''2. Configure MySQL:'''
cd /var/www/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*/* ./
chown apache /var/spool/voipmonitor/
chown apache -R /var/www/html


==Set up the mysql==
Edit <code>/etc/my.cnf.d/mysql-server.cnf</code> and add:
(set there up to half of available RAM for innodb_buffer_pool_size, read more in [[scaling]] section of our doc)
  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


===Set mysql_native_password plugin===
<syntaxhighlight lang="ini">
You need to change the root@localhost's password to none, otherwise you will need to set mysqlpassword option in /etc/voipmonitor.conf)
[mysqld]
Login to mysql and run queries:
innodb_flush_log_at_trx_commit = 2
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY '';
innodb_buffer_pool_size = 8G
FLUSH PRIVILEGES;
skip-log-bin
</syntaxhighlight>


==Activating web and db services==
'''Note on MySQL Authentication Methods:'''
systemctl start httpd.service
systemctl enable httpd.service
systemctl start mysqld.service
systemctl enable mysqld.service
mysql_secure_installation


==Install voipmonitor's sniffer service==
Rocky 9 uses MySQL 8.0 which defaults to <code>caching_sha2_password</code>. Since this guide installs PHP 8.2 (which is newer than PHP 7.4.4), the '''mysql_native_password line is NOT required'''. PHP 8.2 with the mysqlnd driver automatically supports caching_sha2_password.
===Prepare service file===
(It is used by systemd to control service's states)


Please, get a service file [[systemd for voipmonitor service management|here]]
If you see MySQL deprecation warnings about mysql_native_password, you can safely use the standard MySQL 8 authentication without any additional configuration.
vim /etc/systemd/system/voipmonitor.service


===Install the service's binary===
{{Note|1=Set <code>innodb_buffer_pool_size</code> to approximately 50% of your available RAM for a combined server (GUI + DB + Sensor). See the [[Scaling]] guide for more details.}}
cd /usr/local/src/
 
wget --content-disposition http://www.voipmonitor.org/current-stable-sniffer-static-64bit.tar.gz
'''3. Start MySQL and configure authentication:'''
tar xzf voipmonitor*.tar.gz
 
cd `dirname \`find . |grep install-script\``
<syntaxhighlight lang="bash">
mkdir /etc/init.d
systemctl start mysqld
./install-script.sh --no-user-input
systemctl enable mysqld
#at least set interface option in configuration file
</syntaxhighlight>
#vim /etc/voipmonitor.conf
 
systemctl daemon-reload
Set root password for MySQL (can be empty):
systemctl restart voipmonitor.service
 
systemctl enable voipmonitor.service
<syntaxhighlight lang="bash">
mysql -e "ALTER USER root@localhost IDENTIFIED BY ''; FLUSH PRIVILEGES;"
=Firewalld=
</syntaxhighlight>
#Warning! Tested installation of Rocky 9.3 comes with activated firewall restrictions, ensure you have right settings.
 
#If you want pierce thru firewall setting and your address is 192.168.88.208, use comand 'iptables -I INPUT -s 192.168.88.208 -j ACCEPT'.
'''4. Run security configuration:'''
#or just disable firewalld which is activated by default use: 'systemctl stop firewalld' (and 'systemctl disable firewalld' for not start service at startup)
 
Now go to http://yourserver/ and finish the installation.
<syntaxhighlight lang="bash">
mysql_secure_installation
</syntaxhighlight>
 
'''5. Create the VoIPmonitor database:'''
 
<syntaxhighlight lang="bash">
mysqladmin create voipmonitor
</syntaxhighlight>
 
== Web GUI Installation ==
 
'''1. Enable PHP 8.2 from Remi repository:'''
 
Rocky 9 ships with PHP 8.0, but IonCube requires PHP 8.2:
 
<syntaxhighlight lang="bash">
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
</syntaxhighlight>
 
'''2. Install required packages:'''
 
<syntaxhighlight lang="bash">
dnf install wget httpd wireshark php php-gd php-mysqlnd php-mbstring php-zip mtr php-process librsvg2 librsvg2-tools urw-fonts
</syntaxhighlight>
 
'''3. Install IonCube loader:'''
 
<syntaxhighlight lang="bash">
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
</syntaxhighlight>
 
'''4. Disable SELinux:'''
 
SELinux must be disabled for VoIPmonitor to function properly:
 
<syntaxhighlight lang="bash">
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0
</syntaxhighlight>
 
'''5. Download and install GUI:'''
 
<syntaxhighlight lang="bash">
cd /var/www/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>
 
'''6. Configure permissions and start Apache:'''
 
<syntaxhighlight lang="bash">
chown -R apache /var/www/html
mkdir -p /var/spool/voipmonitor
chown apache /var/spool/voipmonitor
systemctl start httpd
systemctl enable httpd
</syntaxhighlight>
 
'''7. Configure cron for alerts and reports:'''
 
<syntaxhighlight lang="bash">
echo "* * * * * root php /var/www/html/php/run.php cron" >> /etc/crontab
systemctl restart crond
</syntaxhighlight>
 
{{Note|Install Postfix for email alert functionality (see "Install Mail Transfer Agent" section below).}}
 
== System Timezone Configuration ==
 
VoIPmonitor uses the system timezone for MySQL timestamps. Configure the correct timezone before starting the sensor:
 
<syntaxhighlight lang="bash">
# Set system timezone (replace with your timezone)
timedatectl set-timezone Europe/Prague
 
# Verify the change
timedatectl
</syntaxhighlight>
 
{{Note|This sets the OS timezone used by MySQL. The GUI timezone is configured separately in '''GUI > Settings > System Configuration > National > Timezone'''.}}
 
== Install Mail Transfer Agent (MTA) ==
 
Email alerts and reports require a functioning MTA. Postfix is recommended for Rocky Linux 9:
 
<syntaxhighlight lang="bash">
# Install Postfix
dnf install postfix
 
# Enable and start Postfix
systemctl enable --now postfix
 
# Verify Postfix is running
systemctl status postfix
</syntaxhighlight>
 
For detailed Postfix/SMTP configuration (relay hosts, authentication), see the [[Alerts|Alerts & Reports]] guide.
 
== Sensor Installation ==
 
'''1. Create systemd service file:'''
 
Create <code>/etc/systemd/system/voipmonitor.service</code> - see [[Systemd_for_voipmonitor_service_management|systemd for voipmonitor service management]] for the template.
 
'''2. Download and install sensor:'''
 
<syntaxhighlight lang="bash">
cd /usr/local/src
wget --content-disposition http://www.voipmonitor.org/current-stable-sniffer-static-64bit.tar.gz -O voipmonitor-sniffer.tar.gz
tar xzf voipmonitor-sniffer.tar.gz
cd voipmonitor-*-static
mkdir -p /etc/init.d
./install-script.sh --no-user-input
</syntaxhighlight>
 
'''3. 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. Use <code>ip link</code> to list available interfaces.}}
 
'''4. Start and enable sensor:'''
 
<syntaxhighlight lang="bash">
systemctl daemon-reload
systemctl start voipmonitor
systemctl enable voipmonitor
</syntaxhighlight>
 
== Firewall Configuration ==
 
'''Option 1: Allow specific IP access:'''
 
<syntaxhighlight lang="bash">
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="YOUR_IP" accept'
firewall-cmd --reload
</syntaxhighlight>
 
'''Option 2: Open HTTP port:'''
 
<syntaxhighlight lang="bash">
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
</syntaxhighlight>
 
'''Option 3: Disable firewall (not recommended for production):'''
 
<syntaxhighlight lang="bash">
systemctl stop firewalld
systemctl disable firewalld
</syntaxhighlight>
 
== Post-Installation: Moving MySQL Data Directory ==
 
If your root partition is too small, move MySQL data to a larger partition (e.g., /home/mysql):
 
<syntaxhighlight lang="bash">
# 1. Stop MySQL
systemctl stop mysqld
 
# 2. Create new directory on larger partition
mkdir -p /home/mysql
 
# 3. Copy existing data (preserving permissions)
cp -rp /var/lib/mysql/* /home/mysql/
 
# 4. Update MySQL configuration
# Edit /etc/my.cnf.d/mysql-server.cnf and change:
# datadir = /home/mysql
 
# 5. Update SELinux context (if SELinux was not disabled)
semanage fcontext -a -t mysqld_db_t "/home/mysql(/.*)?"
restorecon -Rv /home/mysql
 
# 6. Start MySQL
systemctl start mysqld
 
# 7. Verify MySQL is using new directory
mysql -e "SELECT @@datadir;"
</syntaxhighlight>
 
{{Warning|Ensure sufficient disk space for the new location before moving MySQL data.}}
 
== Finish Installation ==
 
Open your browser and navigate to <code>http://your-server-ip/</code> to complete the web-based setup wizard.
 
== See Also ==
* [[Scaling]] - Performance tuning
* [[Sniffer_configuration|Configuration file]] - Full configuration reference
* [[Systemd_for_voipmonitor_service_management|systemd for voipmonitor service management]] - Systemd service file
* [[Debian_12]] - Installation guide for Debian 12
 
== AI Summary for RAG ==
 
'''Summary:''' Step-by-step installation guide for VoIPmonitor on Rocky Linux 9 with PHP 8.2 and MySQL 8.0. Covers MySQL installation and configuration (including innodb_buffer_pool_size sizing at 50% RAM for combined server), Web GUI installation with PHP 8.2 from Remi repository, IonCube loader setup, SELinux disabling, Apache httpd configuration, cron setup for alerts, timezone configuration, Postfix MTA installation for email alerts, optional MySQL data directory relocation, and sensor (sniffer) installation with systemd service management. Includes firewall configuration options using firewall-cmd. PHP 8.2 natively supports MySQL 8's caching_sha2_password authentication - mysql_native_password configuration is NOT required.
 
'''Keywords:''' Rocky Linux 9, installation, MySQL 8.0, PHP 8.2, Remi repository, IonCube, SELinux, Apache httpd, systemd, firewall-cmd, caching_sha2_password, mysql_native_password, innodb_buffer_pool_size, Postfix, MTA, timezone, sensor installation, voipmonitor.conf, RHEL 9, AlmaLinux 9
 
'''Key Questions:'''
* How do I install VoIPmonitor on Rocky Linux 9?
* What PHP version is required for VoIPmonitor on Rocky 9?
* How do I install PHP 8.2 on Rocky Linux 9?
* Do I need to configure mysql_native_password on Rocky 9?
* How do I configure the firewall for VoIPmonitor on Rocky Linux?
* How do I install IonCube loader on Rocky Linux 9?
* How do I disable SELinux for VoIPmonitor?
* How do I move MySQL data directory to a different partition?
* What is the systemd service configuration for VoIPmonitor?
* How do I configure email alerts on Rocky Linux 9?
* Is this guide applicable to AlmaLinux 9 or RHEL 9?

Latest revision as of 18:00, 6 January 2026

Rocky Linux 9 Installation Guide

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:

[mysqld]
innodb_flush_log_at_trx_commit = 2
innodb_buffer_pool_size = 8G
skip-log-bin

Note on MySQL Authentication Methods:

Rocky 9 uses MySQL 8.0 which defaults to caching_sha2_password. Since this guide installs PHP 8.2 (which is newer than PHP 7.4.4), the mysql_native_password line is NOT required. PHP 8.2 with the mysqlnd driver automatically supports caching_sha2_password.

If you see MySQL deprecation warnings about mysql_native_password, you can safely use the standard MySQL 8 authentication without any additional configuration.

ℹ️ Note: Set innodb_buffer_pool_size to approximately 50% of your available RAM for a combined server (GUI + DB + Sensor). See the Scaling guide for more details.

3. Start MySQL and configure authentication:

systemctl start mysqld
systemctl enable mysqld

Set root password for MySQL (can be empty):

mysql -e "ALTER USER root@localhost IDENTIFIED BY ''; FLUSH PRIVILEGES;"

4. Run security configuration:

mysql_secure_installation

5. Create the VoIPmonitor database:

mysqladmin create voipmonitor

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&allowed&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
systemctl restart crond

ℹ️ Note: Install Postfix for email alert functionality (see "Install Mail Transfer Agent" section below).

System Timezone Configuration

VoIPmonitor uses the system timezone for MySQL timestamps. Configure the correct timezone before starting the sensor:

# Set system timezone (replace with your timezone)
timedatectl set-timezone Europe/Prague

# Verify the change
timedatectl

ℹ️ Note: This sets the OS timezone used by MySQL. The GUI timezone is configured separately in GUI > Settings > System Configuration > National > Timezone.

Install Mail Transfer Agent (MTA)

Email alerts and reports require a functioning MTA. Postfix is recommended for Rocky Linux 9:

# Install Postfix
dnf install postfix

# Enable and start Postfix
systemctl enable --now postfix

# Verify Postfix is running
systemctl status postfix

For detailed Postfix/SMTP configuration (relay hosts, authentication), see the Alerts & Reports guide.

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 voipmonitor-sniffer.tar.gz
tar xzf voipmonitor-sniffer.tar.gz
cd voipmonitor-*-static
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

ℹ️ Note: Replace eth0 with your actual network interface name. Use ip link to list available interfaces.

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

Post-Installation: Moving MySQL Data Directory

If your root partition is too small, move MySQL data to a larger partition (e.g., /home/mysql):

# 1. Stop MySQL
systemctl stop mysqld

# 2. Create new directory on larger partition
mkdir -p /home/mysql

# 3. Copy existing data (preserving permissions)
cp -rp /var/lib/mysql/* /home/mysql/

# 4. Update MySQL configuration
# Edit /etc/my.cnf.d/mysql-server.cnf and change:
# datadir = /home/mysql

# 5. Update SELinux context (if SELinux was not disabled)
semanage fcontext -a -t mysqld_db_t "/home/mysql(/.*)?"
restorecon -Rv /home/mysql

# 6. Start MySQL
systemctl start mysqld

# 7. Verify MySQL is using new directory
mysql -e "SELECT @@datadir;"

⚠️ Warning: Ensure sufficient disk space for the new location before moving MySQL data.

Finish Installation

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

See Also

AI Summary for RAG

Summary: Step-by-step installation guide for VoIPmonitor on Rocky Linux 9 with PHP 8.2 and MySQL 8.0. Covers MySQL installation and configuration (including innodb_buffer_pool_size sizing at 50% RAM for combined server), Web GUI installation with PHP 8.2 from Remi repository, IonCube loader setup, SELinux disabling, Apache httpd configuration, cron setup for alerts, timezone configuration, Postfix MTA installation for email alerts, optional MySQL data directory relocation, and sensor (sniffer) installation with systemd service management. Includes firewall configuration options using firewall-cmd. PHP 8.2 natively supports MySQL 8's caching_sha2_password authentication - mysql_native_password configuration is NOT required.

Keywords: Rocky Linux 9, installation, MySQL 8.0, PHP 8.2, Remi repository, IonCube, SELinux, Apache httpd, systemd, firewall-cmd, caching_sha2_password, mysql_native_password, innodb_buffer_pool_size, Postfix, MTA, timezone, sensor installation, voipmonitor.conf, RHEL 9, AlmaLinux 9

Key Questions:

  • How do I install VoIPmonitor on Rocky Linux 9?
  • What PHP version is required for VoIPmonitor on Rocky 9?
  • How do I install PHP 8.2 on Rocky Linux 9?
  • Do I need to configure mysql_native_password on Rocky 9?
  • How do I configure the firewall for VoIPmonitor on Rocky Linux?
  • How do I install IonCube loader on Rocky Linux 9?
  • How do I disable SELinux for VoIPmonitor?
  • How do I move MySQL data directory to a different partition?
  • What is the systemd service configuration for VoIPmonitor?
  • How do I configure email alerts on Rocky Linux 9?
  • Is this guide applicable to AlmaLinux 9 or RHEL 9?