Solution WARNING: The “syslog” option is deprecated

I noticed once a warning in the /var/log/samba/log. file:

[2018/04/13 20:51:05.280655,  1] ../lib/param/loadparm.c:1629(lpcfg_do_global_parameter)
  WARNING: The "syslog" option is deprecated

As reported, the “syslog” option is obsolete, and to prevent the warning from appearing, it must be removed from the configuration.

I opened the configuration file in a text editor:

sudo nano /etc/samba/smb.conf

Found this option:

syslog = 0

And commented on it:

#syslog = 0

After the changes you need to restart samba, you can do this:

sudo service samba restart
sudo restart smbd
sudo restart nmbd

After that, the warning no longer appeared.

Installing Magento on Ubuntu

On the test, I install Magento in Ubuntu Server 16.04 & PHP 7.

First, update the system and install the necessary components:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2 php mysql-server mysql-client openssl libcurl3 php-curl php-gd php-mcrypt php-xml php-intl php-zip php-mbstring php-soap php-mysql php-cli php-json libapache2-mod-php php-xsl composer

Open the PHP configuration file in a text editor:

sudo nano /etc/php/7.0/apache2/php.ini

And install or make sure that memory_limit is at least 512M:

memory_limit = 512M

Activate the necessary modules:

sudo a2enmod rewrite
sudo phpenmod mcrypt

In the apache2 configuration, add the site or edit the standard:

sudo nano /etc/apache2/sites-enabled/000-default.conf

Add the following parameters inside the VirtualHost tags:

<Directory /var/www/html/magento_test>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>

Restart apache2 to apply the changes:

sudo service apache2 restart

Connect to the MySQL server, create the database and the user:

mysql -u root -p
CREATE DATABASE magento;
CREATE USER magento@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON magento.* TO magento@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit

Download the archive with the latest version of Magento and unpack it:

cd /tmp/
wget https://github.com/magento/magento2/archive/2.2.3.tar.gz
tar xzvf 2.2.3.tar.gz

Move the files to the web server directory:

sudo mv magento2-2.2.3 /var/www/html/magento_test

Execute the command:

cd /var/www/html/magento_test
sudo composer install

Install on the files of the right, the owner and the group under which the web server is running:

cd /var/www/html/magento_test
sudo find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;
sudo find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;
sudo chmod u+x bin/magento
sudo chown -R www-data:www-data /var/www/html/magento_test/

Open the browser http://SERVER/magento_test and continue the installation process by following the instructions, remember the login/password and “Magento Admin Address”, as it will open the admin panel.

After installation, let’s see where php is located to correctly specify the path in cron jobs (usually it’s in /usr/bin/php):

which php

Open crontab:

sudo crontab -u www-data -e

And add the tasks:

* * * * * /usr/bin/php /var/www/html/magento_test/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/html/magento_test/var/log/magento.cron.log
* * * * * /usr/bin/php /var/www/html/magento_test/update/cron.php >> /var/www/html/magento_test/var/log/update.cron.log
* * * * * /usr/bin/php /var/www/html/magento_test/bin/magento setup:cron:run >> /var/www/html/magento_test/var/log/setup.cron.log

This completes the installation of Magento.

See also:
Solving the “Autoload error” when installing Magento
Using and configuring CRON

Solving the “Autoload error” when installing Magento

Once installed Magento in Ubuntu and noticed in the browser the following error:

Autoload error

There were also pieces of code, depending on the open page.

In my case, the error occurred because of the uninstalled libapache2-mod-php, installed it with the command:

sudo apt-get install libapache2-mod-php

After that the error did not appear and I continued the installation of Magento.

Installing Remmina on Linux

Remmina – remote desktop client, supports SSH, VNC, RDP, NX, SFTP, XDMCP.

You can install Remmina in Ubuntu/Debian using the command:

sudo apt-get install remmina

Install in CentOS:

yum install remmina

Run with the command:

remmina

After launching it is enough to specify the address of the node and enter the login/password.
On the test through the Remmina client, I successfully connected to the remote desktop of Windows 10.

See also:
Installing xrdp on Ubuntu

Installing xrdp on Ubuntu

xrdp – RDP server for Linux

It is installed in Ubuntu with the following command:

sudo apt-get install xrdp

To connect to an xrdp server from Windows, you can use the standard Remote Desktop client by typing mstsc.exe at the command prompt.
The configuration is located here /etc/xrdp/, logs are written here – /var/log/xrdp-sesman.log

You can restart xrdp like this:

sudo /etc/init.d/xrdp restart

You can also install the Xfce graphical shell:

sudo apt-get -y install xfce4

And specify it by default.

echo xfce4-session >~/.xsession

I recommend not using root user to work in a graphical environment, but create an individual user.
See my article – Administering Ubuntu Users

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”.

Sending Asterisk voicemail to multiple emails

Let’s say the voice mail is configured as I described in the article – Setting up voicemail in Asterisk.
There is the following context:

[voicemailcontext]
207 => 1111,Username,test@example.com,,attach=yes|tz=ua|delete=yes

If you want to send a voice message to several email addresses, then instead of test@example.com, for example, testmail:

[voicemailcontext]
207 => 1111,Username,testmail,,attach=yes|tz=ua|delete=yes

Then open the /etc/aliases file in a text editor:

sudo nano /etc/aliases

And let’s specify aliases for testmail:

testmail: support@example.net,user@example.net

For the changes to take effect, you need to update the alias database with the command:

cd /etc
sudo newaliases

Done, Asterisk will send a message to testmail, and it will be automatically forwarded to the specified addresses.

See also:
Redirecting mail for the root user