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

Create email aliases in iCloud Mail

Mail aliases allow you to hide the current mail address.

To create them, you need to open the “Mail” application on iCloud.com, select “Settings”, “Accounts” and “Add aliaas”.
Incoming messages for the created alias will be highlighted with the color that was specified when adding.
The created aliases can be disabled or deleted.

On the phone or computer to send messages from the created alias, you must select it in the mail settings.

Installing and Configuring Zabbix Server on Linux Ubuntu

Zabbix — system monitoring, tracking servers and network equipment.

Below I will give an example of installing Zabbix Server and Zabbix Agent from the official Ubuntu repository, if you need to install the latest version, you must first install Zabbix repositories, for example, see my article – Installing Zabbix Server 3.4 on Ubuntu 16.04

Install the server, web interface and agent:

sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent traceroute fping

If during the installation did not configure the mysql parameters, then manually create the MySQL user and complete the rights to the database:

mysql -uroot -p
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'PASSWORD';
exit

We import tables into the database:

cd /usr/share/zabbix-server-mysql
sudo gunzip schema.sql.gz
sudo gunzip images.sql.gz
sudo gunzip data.sql.gz
mysql -uroot -p zabbix < schema.sql
mysql -uroot -p zabbix < images.sql
mysql -uroot -p zabbix < data.sql

Configs are located at /etc/zabbix/

The web interface configuration is located at /etc/apache2/conf-available/zabbix
If it does not exist, you can copy the template and configure:

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

Or we will make a symbolic link to the web server directory on the zabbix files:

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

Open the configuration file PHP for example in the editor nano (CTRL+X for exit, y/n for saving or canceling the changes):

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

And change some of the minimum parameters:

date.timezone = Europe/Kiev
max_execution_time 300
memory_limit 128M
post_max_size 16M
upload_max_filesize 2M
max_input_time 300

For the changes to take effect, you must restart the web server:

sudo /etc/init.d/apache2 restart

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.
When saving the configuration file zabbix.conf.php there will be a message that there is no write permission, so we will temporarily allow them:

sudo chmod 777 /etc/zabbix

When the configuration file is saved back:

sudo chmod 755 /etc/zabbix

Also, in the second configuration file zabbix_server.conf, the login and password for connecting to the MySQL database (same as in zabbix.conf.php):

sudo nano /etc/zabbix/zabbix_server.conf

If the message appears in the web interface that the zabbix server is not running, then you need to change the START=no parameter to START=yes in the /etc/default/zabbix-server file and execute the start command:

sudo service zabbix-server start

After installation, I recommend changing the password to admin and disabling the guest user.

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