Installing Zabbix Server 3.4 on Ubuntu 16.04

On the test I will install Zabbix Server 3.4 in Ubuntu Server 16.04.

First of all, we will install a repository with Zabbix 3.4 version for Ubuntu 16.04, as the old version is available in the official Ubuntu repository:

sudo wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
sudo dpkg -i zabbix-release_3.4-1+xenial_all.deb
sudo apt update

Now run the Zabbix Server and Zabbix Agent installation command:

sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent

Connect to MySQL:

mysql -uroot -p

Create the database and the user:

create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'PASSWORD';
quit;

I import the tables into the created database:

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

Open the configuration file in a text editor and where “DBPassword” is the password for the database:

sudo nano /etc/zabbix/zabbix_server.conf

Open the configuration file in a text editor and where “DBPassword” write the password to the database:

systemctl restart zabbix-server zabbix-agent
systemctl enable zabbix-server zabbix-agent

To restart it is still possible so:

sudo service zabbix-server start

In php.ini, specify the date.timezone, for example Europe/Kiev, or uncomment it in /etc/zabbix/apache.conf if it is copied to the web server configuration:

sudo cp /etc/zabbix/apache.conf /etc/apache2/sites-enabled/zabbix.conf

Or we will make the link where we need:

sudo ln -s /usr/share/zabbix/ /var/www/html/

Open the web interface at http://SERVER/zabbix/ and follow the prompts for further installation.
By default, the user name for logging in through the web interface is admin, the password is zabbix.

See also my article:
Installing and Configuring Zabbix Server on Linux Ubuntu

Updating phpBB 3.1.x to phpBB 3.2.x

On the test, I will update the phpBB 3.1.9 forum to the version of phpBB 3.2.2.

System requirements phpBB 3.2 if necessary, you can see here https://www.phpbb.com/support/docs/en/3.2/ug/

Be sure to make a backup copy of the database and forum files.

I recommend that you perform an update on the test virtual server, running a copy of the forum from the backups, because in my case there were errors and it took them a while to fix them, and then you can update them to the main one in a similar way quickly.

We proceed to update, download the archive with the new version of phpBB 3.2.x and unpack it:

wget https://www.phpbb.com/files/release/phpBB-3.2.2.zip
unzip phpBB-3.2.2.zip

In the unpacked forum data, delete the file config.php and these directories: files/, images/, store/.

In the phpBB data, what’s on the web server will be deleted except for the ext/, files/, images/, store/ and config.php file.

Move the remaining downloaded data to the directory with the forum data, agree to overwrite the file in the ext/ directory.

If the rights to files and owner change, for example, you can specify them as follows:

sudo chown -R www-data:www-data /var/www/forum/

If the database of the forum is large, then you can execute the command in the root directory of the forum:

php ./bin/phpbbcli.php db:migrate --safe-mode

Open the forum address in the browser by adding /install/app.php/update or /install/database_update.php at the end, select the “Update” tab, select “Update database only”, start the update process and wait for the completion.

After the successful update, delete the install directory:

rm install

See also my articles:
Solution of error “A module already exists” and “The installer detected a timeout” when updating phpBB
Import and export MySQL databases
Updating phpBB 3.1.8 to phpBB 3.1.9
Updating phpBB 3.0.x to phpBB 3.1.x
Other about phpBB

Solution of error “A module already exists” and “The installer detected a timeout” when updating phpBB

I updated phpBB 3.1.9 once to phpBB version 3.2.2 and noticed the following error:

The installer detected a timeout
The installer has detected a timeout, you may try to refresh the page, which may lead to data corruption. We suggest that you either increase your timeout settings or try to use the CLI.

Cleaned the table “phpbb_migrations” in the forum database:

TRUNCATE TABLE phpbb_migrations;

And again launched the update, but got another error:

A module already exists: UCP_AUTH_LINK_MANAGE

The standard Profile module was naturally installed, it could be disabled, but not deleted.
Therefore, I found it in the “phpbb_modules” table and deleted it, thus causing the update script to think that it is not installed:

SELECT * FROM `phpbb_modules` WHERE `module_langname` LIKE 'UCP_AUTH_LINK_MANAGE';

After continuing the update noticed another error:

A module already exists: ACP_CONTACT_SETTINGS

The Contact module was not even installed, after that I also found it in the table and deleted it, and also found and deleted “UCP_AUTH_LINK_MANAGE” once again, because the update script restored it:

SELECT * FROM `phpbb_modules` WHERE `module_langname` LIKE 'ACP_CONTACT_SETTINGS';
SELECT * FROM `phpbb_modules` WHERE `module_langname` LIKE 'UCP_AUTH_LINK_MANAGE';

After removing the modules from the “phpbb_modules” table, I cleared the “phpbb_migrations” table:

TRUNCATE TABLE phpbb_migrations;

I launched the phpBB update and it was successful.

See also:
Updating phpBB 3.0.x to phpBB 3.1.x

The solution to the warning “mismatch_cnt is not 0 on /dev/md*”

Replaced once the junk drive in the software RAID1, added it to the raid, it successfully synchronized, installed GRUB.
After a while I received an email message:

Subject: Cron <root@server> /usr/sbin/raid-check
WARNING: mismatch_cnt is not 0 on /dev/md2

In my case, raid-check found that the mismatch_cnt counter is not equal to 0 for /dev/md2, which means that there may be broken sectors on the disk, or it simply needs to be resynchronized. Since I installed GRUB after adding the disk to the raid, this is probably the cause.

Example of viewing the counters of all arrays:

cat /sys/block/md*/md/mismatch_cnt

Or each in turn:

cat /sys/block/md0/md/mismatch_cnt
cat /sys/block/md1/md/mismatch_cnt
cat /sys/block/md2/md/mismatch_cnt

View the status of raids:

cat /sys/block/md*/md/sync_action

If mismatch_cnt is not 0 for any array, then you can try to resynchronize it:

echo 'repair' >/sys/block/md2/md/sync_action

And check:

echo 'check' >/sys/block/md2/md/sync_action

If you want to cancel the action:

echo 'idle' >/sys/block/md2/md/sync_action

Let’s see the synchronization status and other data of the array:

cat /proc/mdstat

If errors appear due to a bad disk, I recommend that you look at SMART and check it as I wrote in these articles:
Diagnostics HDD using smartmontools
Linux disk test for errors and broken sectors

See also:
How to fix the problem with mdadm disks

Troubleshooting PHP Warning “Permission denied /var/cpanel/php/sessions/ea-php56/”

Once I updated EasyApache 3 to EasyApache 4 in cPanel and noticed in the PHP logs the following:

[29-Mar-2018 15:54:45 UTC] PHP Warning:  Unknown: open(/var/cpanel/php/sessions/ea-php56/sess_3d96o7nnlnnr473p8619vqkdm1, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[29-Mar-2018 15:54:45 UTC] PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/cpanel/php/sessions/ea-php56) in Unknown on line 0

The warning occurs because PHP can not write session files to a directory to which it does not have access rights.
I looked at the rights of this directory, the group and owner was root, and it was also allowed to write and execute for everyone, except reading.

To resolve this warning, you can open full access for everyone:

chmod 777 /var/cpanel/php/sessions/ea-php56

Or open a PHP configuration, for example in the nano editor:

nano /opt/cpanel/ea-php56/root/etc/php.ini

To find:

session.save_path = "/var/cpanel/php/sessions/ea-php56"

And change to:

session.save_path = "/tmp"

That used to be on the old EasyApache3 in the PHP configuration /usr/local/lib/php.ini.

After that, the warning did not appear.

See also:
Migration from EasyApache 3 to EasyApache 4

The warning solution “The MaxMind Geolite databases will soon be deprecated” in Cpanel

Once launched a server security check by clicking “Check Server Security” in “Main” – “Plugins” – “ConfigServer Security & Firewall” and saw a warning:

Firewall Check
CC_OLDGEOLITE option check
The MaxMind Geolite databases will soon be deprecated, disable CC_OLDGEOLITE to start using the new Geolite2 databases

This option determines which database to use, the old MaxMind Geolite or the new MaxMind Geolite2.
If the option “CC_OLDGEOLITE” is 1, which is in my case, then the old one is used, and if 0, then the new one.

To enable the use of a new one, open the CSF configuration for example in the text editor nano:

nano /etc/csf/csf.conf

Find the option CC_OLDGEOLITE and change its value from 1 to 0:

CC_OLDGEOLITE = "0"

In the nano editor, the Ctrl+X keys are used to exit, and y/n and Enter to save or discard the changes.

After the changes, restart CSF by clicking “Firewall Restart” in the menu “Main” – “Plugins” – “ConfigServer Security & Firewall”.

How to make a bootable USB flash drive using UltraISO

I’ll describe the process of creating a bootable USB flash drive with Windows using UltraISO:

1) Start UltraISO, select the required ISO image of the operating system by clicking the menu “File”> “Open”.

2) We connect the USB flash drive to the computer, in UltraISO we open the menu “Bootable”> “Write Disk Image …”.
There where “Disk Drive” we will select a USB flash drive and press the “Write” button below to start the process of copying files from the ISO image.
Before starting the copying, all data from the USB flash drive will be erased.

At the end of the process, the USB flash drive will be ready.

See also:
How to make a bootable USB flash drive with Windows

Reset HP A5800 Switch to Factory Default Configuration

On the test, I reset the configuration on the HP A5800 Series Switch JC103A.

And so, connect to the device and see what files are in the device’s memory:

dir

By default, the configuration is saved in the file config.cfg, let’s say that it is, so we’ll delete it:

delete config.cfg

We removed the configuration file, now we will reboot the device:

reboot

On the offer to keep the configuration we will refuse and on the next issue agree to the reboot:

This command will reboot the device. Current configuration will be lost, save current configuration? [Y/N]:n
This command will reboot the device. Continue? [Y/N]:y

Done, the switch will start with the default configuration, after which you can begin to configure, for example, as I described in the article – Настройка HP 5800

You can also try to reset the configuration as follows:

reset saved-configuration
reboot

Either through the Boot menu, to open it, when you turn on the device, press Ctrl+D and pressing the number 5, we select in the menu the reset of the configuration:

5. Restore to factory default configuration

Then, press 0 to select the reboot:

0. Reboot

When starting the switch, make sure that the configuration is reset:

display current-configuration
display saved-configuration

Solution of error “The transceiver type is not supported by port hardware” on HP A5800

I noticed once on the switch HP A5800 Series Switch JC103A, when inserting the module Foxgate SFP-1SM-1550nm-10SC (10km), the following error:

%Apr 26 12:18:56:384 2000 HP OPTMOD/4/MODULE_IN:
 GigabitEthernet1/0/24: The transceiver is UNKNOWN_SFP_PLUS.
%Apr 26 12:18:56:524 2000 HP OPTMOD/5/CHKSUM_ERR:
 GigabitEthernet1/0/24: The checksum of transceiver information is bad!
%Apr 26 12:18:56:674 2000 HP OPTMOD/3/TYPE_ERR:
 GigabitEthernet1/0/24: The transceiver type is not supported by port hardware!

Alternatively, you can try running the command:

transceiver phony-alarm-disable

But in my case this command did not help.
Also noticed that the error did not occur when inserting a similar module is not at 10km, but at 3km – Foxgate SFP-1SM-1550nm-3SC 3km.

The problem was solved by updating the firmware of the switch, as I did in the article – HP A5800 Firmware Upgrade
I updated the firmware from “A5800_5820X-CMW520-R1809P11” to “A5800_5820X-CMW520-R1810P13”.
After the upgrade, both modules were working and there were no errors in the console.

See also:
Using third-party SFP modules in Cisco switches