Upgrading PHP Version on Ubuntu 14.04

Once it was necessary to upgrade the version of PHP 5.5.9 to 5.6 on Ubuntu Server 14.04 LTS, the usual update of the system components did not help:

sudo apt-get update
sudo apt-get upgrade

You can try to upgrade the system to 16.04 or higher as I described in the article Updating Ubuntu 14.04 to 16.04. Together with the system will be updated and PHP.

If the system update fails, you can add a third-party source with PHP:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

And install the correct version from it, for example PHP 5.6:

sudo apt-get install php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml

Since there are several installed versions, disable the old version and activate the installed one:

sudo a2dismod php5
sudo a2enmod php5.6
sudo service apache2 restart

Similarly, you can install PHP 7.2:

sudo apt-get install php7.2
sudo a2dismod php5.6
sudo a2enmod php7.2
sudo service apache2 restart

Or PHP 7.0:

sudo apt-get install php7.0
sudo a2dismod php7.2
sudo a2enmod php7.0
sudo service apache2 restart

Let’s Encrypt Plugin in cPanel

To use Let’s Encrypt in cPanel, you need to install a special plugin.
To do this, connect to the server by SSH and execute the command from the root user:

/scripts/install_lets_encrypt_autossl_provider

After installing the Let’s Encrypt plug-in, you can use it in the AutoSSL management menu (WHM >> Home >> SSL/TLS >> Manage AutoSSL).

If you need to remove the plugin, then run the command:

/usr/local/cpanel/scripts/uninstall_lets_encrypt_autossl_provider

See also:
Установка Certbot в Ubuntu

Facebook blocks users after registration

Once used the social network Facebook, deleted the account and a year later, maybe a little more, decided to re-register.
It was around December 2017.
After the registration, I added one photo, Facebook offered to add friends. In the list of suggested friends, I added a couple of friends, and on several unknown people I clicked a cross, hoping that they would not be offered Facebook, I began to correspond with friends, and after a while the message was displayed that the account was deactivated and you need to attach one more photo.
I attached the photo, in the course of the day the account was activated, but after a while it was deactivated again, added the same photo – activated, I was asked for a photo of the passport for the third time, added – activated, later deactivated again and asked for another simple photo, after that the following message was displayed:

You Can’t Log In Right Now.
When we study your photo, we will contact you. For security reasons, we will now exit Facebook from you.

This message was displayed for about two months from 12.2017 to 02.2018, then it was generally displayed that the account was blocked.
Several times i wrote in technical support that he was blocked by mistake.
With the email that was used when registering the account it was impossible to register again, so I had to wait and on 06/03/2018 it was finally unblocked.

But I was already disappointed by such weak technical support and crooked locking algorithms, so I just deleted the account.
See also my article – How to delete a Facebook account?

Installing OpenLDAP Server on Ubuntu

Install the necessary packages:

sudo apt-get install slapd ldap-utils

During the installation, you will be prompted for a password for the admin user.

Reconfigure the slapd package:

sudo dpkg-reconfigure slapd

We will test the LDAP connection (should display “anonymous”):

ldapwhoami -H ldap:// -x

To manage LDAP, set up the web interface phpLDAPadmin:

sudo apt-get install phpldapadmin

To open the web interface phpLDAPadmin, type in the browser http://example.com/phpldapadmin, where instead of example.com, specify your domain.
On the opened page we will enter the password which was specified at installation, and where the login:

cn=admin,dc=example,dc=com

Restart example:

sudo /etc/init.d/slapd start

Configuring Software RAID1 on a Running Ubuntu System

Here is an example of migrating a running Ubuntu system to a software RAID1.
In the process, you will need to perform two reboots.

The first step is to switch to the root user if not yet:

sudo -i

Let’s see a list of disks and partitions:

fdisk -l
fdisk -l | grep '/dev/sd'
lsblk -o NAME,UUID

Suppose that the system uses one disk, for example /dev/sda and has one main partition, /dev/sda1.
For the test, I installed a clean Ubuntu Server 18.04, the disk was parted by default, swap was the file on the same partition.

To create a raid, we connect another disk of the same size, it will be called /dev/sdb.

Continue reading “Configuring Software RAID1 on a Running Ubuntu System”

Configuring Storm Control on Alcatel OmniStack LS 6224

In this article I will give an example of setting up broadcast and multicast control on the Alcatel OmniStack LS 6224 switch.

Connect to the switch and go into the configuration mode:

enable
configure

Select the ports on which you want to enable Storm Control:

interface range ethernet e1-24

Turn on the control of broadcast traffic and specify a limit of 70 kilobits per second:

port storm-control broadcast enable
port storm-control broadcast rate 70

If you want to limit also multicast traffic, then execute the following command:

port storm-control include-multicast

The standard value is 3500, the possible range for ethernet ports is 70 – 100000, for gigabit ports 3500 – 1000000.

Now it remains to exit the configuration mode and save the configuration:

exit
exit
copy running-config startup-config

To see the data of the packet counters on the port, for example:

show interfaces counters ethernet g1

Firmware Upgrade Alcatel OmniStack LS 6224

I will describe the process of updating the firmware on Alcatel OmniStack LS 6224.

Let’s connect to the device and switch to the mode of elevated privileges:

enable

See the current firmware version:

show version

We look at what firmware versions are downloaded and what is active:

show bootvar

See how much memory is free:

dir

Run the command to copy the firmware file from the TFTP server to the switch:

copy tftp://10.0.0.18/alc6224-1.7.1.12.img image-2

I had an active firmware image-1, so I saved a new one like image-2.
I used the firmware version 1.7.1.12
https://files.ixnfo.com/Firmware/Alcatel-Lucent/alc6224-1.7.1.12.img

Let’s make an active uploaded firmware:

boot system image-2
show bootvar

We reboot the switch:

reload

After reboot, the switch will boot with the new firmware.

If necessary, the firmware file can also be copied from the switch to TFTP:

copy image-1 tftp://10.10.0.18/image-1

How to start the TFTP server I described in these articles:
Installing and Configuring a TFTP Server in Ubuntu
Starting a TFTP server in Windows

Reset Alcatel OmniStack LS 6224

I will describe examples of resetting the settings on the Alcatel OmniStack LS 6224 in several ways.

1) Connect to the device and execute the command to delete the configuration and restart:

enable
delete startup-config
reload

Just in case, before deleting the configuration, you can make a backup copy to the tftp server or locally:

copy startup-config tftp://10.10.0.18/startup-config 
copy startup-config startup-config-backup
dir

To return it is possible so:

copy tftp://10.10.0.18/startup-config startup-config
copy startup-config-backup startup-config

2) If the password for the switch is unknown, then connect to it with a console cable, the speed is usually 9600.
Turn on the power switch, waiting for the message:

Autoboot in 2 seconds – press RETURN or Esc. to abort and enter prom.

When the message appears – press the “Enter” or “Esc” key, in the resulting menu select “[3] Password Recovery Procedure”, then “[7] Back” and wait for the device to start.

After that, the switch will start and will not ask for the password, just delete the configuration as I wrote above or change the password to the user:

enable
configure
username admin password PASSWORD level 15
exit
copy running-config startup-config
reload