Installation: различия между версиями

Материал из WiKi - UserSide
Нет описания правки
Нет описания правки
Строка 140: Строка 140:
==== Installation ====
==== Installation ====
  sudo apt install -y redis-server
  sudo apt install -y redis-server
 
==== Setting ====
==== Setting ====
By default Redis accepts connections without a password, but we strongly recommend setting a password. Since the password is transmitted openly (Redis does not provide encryption as it focuses on query speed and extra steps like encryption do not apply), you need to create a really long and complex password. This can be done, for example, using the ''sha256sum'' utility as follows:
By default Redis accepts connections without a password, but we strongly recommend setting a password. Since the password is transmitted openly (Redis does not provide encryption as it focuses on query speed and extra steps like encryption do not apply), you need to create a really long and complex password. This can be done, for example, using the ''sha256sum'' utility as follows:

Версия от 16:35, 2 февраля 2023

en | ru

* this article is under translation

ATTENTION: These instructions are valid for ERP USERSIDE versions 3.11 and above. For versions 3.10 and below - use separate installation instructions for 3.10.

Description

For the sake of simplicity, commands for the Linux Debian 11 operating system will be considered. For experienced system administrators, it should not be difficult to use similar commands for another operating system. If you do not feel confident in the administration of operating systems, we recommend that you use either Debian or Ubuntu Server. Because of their simplicity and also because our technical support team has a much better understanding of Debian-like distributions. You are much more likely to be able to get an advise on anything not related to ERP USERSIDE, but related to the administration of the operating system, if you have Debian or a similar distribution based on it.

On the other hand, if you are an experienced system administrator and have skills and experience with Docker, it may be more convenient for you to use a ready-made environment based on the Docker images that we have specially prepared, including everything you need for ERP USERSIDE. In this case, you won't have to configure anything other than to make simple Docker bundle settings.

This instruction is repeated in its entirety on a Debian 10 test server and this process is recorded as a screencast. Maybe someone will find it useful: https://youtu.be/Zls7MA1rV6Q

Requirements

ERP USERSIDE requires various system applications and services, such as a PHP language interpreter with a set of extensions, a WEB-server, a database management system and others. This section will list such requirements depending on the ERP USERSIDE version.

Also note that your operating system must be configured with the correct time zone and locale. This determines the correctness of the information displayed and the correctness of sorting.

The list of required PHP extensions contains all extensions that are not part of the PHP core. Some of these extensions may be bundled with the main PHP package or as part of the php-common package, while others must be installed separately.

3.16, 3.17 (current stable)

  • PHP: 7.2 - 7.4
  • PHP extensions: ctype, gd, json, libxml, mbstring, openssl, pdo, pdo_pgsql, posix, simplexml, snmp, sockets, zlib, pcntl
  • PHP optional extensions: ldap, soap
  • Python: 3.7+
  • Python Modules: pip, virtualenv
  • PostgreSQL: 10+
  • Redis: 5+
  • RabbitMQ: 3.8+
  • Supervisor

3.15

  • PHP: 7.1 - 7.4
  • PHP extensions: ctype, gd, json, libxml, mbstring, openssl, pdo, pdo_pgsql, posix, simplexml, snmp, sockets, zlib
  • PHP optional extensions: ldap, soap
  • PostgreSQL: 10+
  • Redis: 5+

3.14

  • PHP: 7.1 - 7.3
  • PHP extensions: ctype, gd, json, libxml, mbstring, openssl, pdo, pdo_pgsql, posix, simplexml, snmp, sockets, zlib
  • PHP optional extensions: ldap, soap
  • PostgreSQL: 10+
  • Redis: 5+

3.13

  • PHP: 7.1 - 7.3
  • PHP extensions: ctype, gd, json, libxml, mbstring, openssl, pdo, pdo_pgsql, posix, simplexml, snmp, sockets, zlib
  • PHP optional extensions: ldap, soap
  • PostgreSQL: 9.6+
  • Redis: 5+

3.12

  • PHP: 7.0 - 7.1
  • PHP extensions: ctype, gd, json, libxml, mbstring, openssl, pdo, pdo_pgsql, posix, simplexml, snmp, sockets, zlib
  • PHP optional extensions: ldap, soap
  • PostgreSQL: 9.5+

3.11

  • PHP: 5.6 - 7.1
  • PHP extensions: ctype, gd, json, libxml, mbstring, openssl, pdo, pdo_pgsql, posix, simplexml, snmp, sockets, zlib
  • PHP optional extensions: ldap, soap
  • PostgreSQL: 9.5+
  • MySQL: 5.6 - 5.7

Main Agreements

The directory where ERP USERSIDE is installed is /var/www/userside. Inside this directory must be a subdirectory userside3, which is the root directory for the WEB-server. If you want to use a different directory for ERP USERSIDE, don't forget to correct all the examples in this manual accordingly.

Create a directory:

sudo mkdir -p /var/www/userside/userside3
sudo chown -R www-data:www-data /var/www/userside

You need to allocate a domain name for ERP USERSIDE. The examples below use userside.mycompany.com, but you will need to replace it with your own.

Installing the required components

The installation will be shown for the latest current ERP USERSIDE version 3.16. For other versions, you can modify these commands yourself to get the right set of applications installed for certain versions. Also note that some components are not needed for other versions of ERP USERSIDE.

First install the utilities that will be needed later in the installation process. They are required for any ERP USERSIDE version. You can copy lines one by one and paste them into the command line of your operating system.

sudo apt update
sudo apt install -y apt-transport-https lsb-release ca-certificates curl gnupg debian-keyring debian-archive-keyring

Copy and paste the following lines entirely:

sudo tee /etc/apt/sources.list.d/contrib-non-free.list << EOL
deb http://deb.debian.org/debian/ $(lsb_release -sc) contrib non-free
deb http://deb.debian.org/debian/ $(lsb_release -sc)-updates contrib non-free
deb http://security.debian.org/debian-security $(lsb_release -sc)-updates contrib non-free
EOL
sudo apt update
sudo apt install -y libsnmp-dev snmp-mibs-downloader

PostgreSQL

Alternative official repository

To be able to always install and update to the latest version of PostgreSQL, add an alternative official repository to your operating system by running the commands:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" | sudo tee -a /etc/apt/sources.list.d/pgdg.list
sudo apt update

If you have a different operating system, you can find the necessary commands for it at official PostgreSQL website.

The step of adding an alternate repository here and hereafter is optional, but only if your operating system's main repository contains packages of those versions that fall within the range required for the ERP USERSIDE version being installed.

Installation

Before you install PostgreSQL in your operating system, your local locale and the correct time zone must be set. This can also be done later, but it is easier if it is done before installation. Run the following command to make sure that the desired locale is present:

locale -a

If your local locale is not among those listed, install it. To do this, just edit the file /etc/locale.gen by removing the comments before the line(s) with the desired locale, and then run the command:

sudo locale-gen

If you need to change the default locale, do:

sudo dpkg-reconfigure locales

To change the time zone, follow the steps below:

sudo timedatectl set-timezone Europe/Kyiv

You can now proceed to install PostgreSQL:

sudo apt install -y postgresql-14 postgresql-14-postgis-3

Setting

Create a user (role) and database for ERP USERSIDE. The example below creates a user named userside and a database with the same name. The PostGis extension is then connected to the database, required to manipulate geometric data. After the first line has been executed, you will need to enter the password for the new user twice - make a note of this password, you will need it later to install ERP USERSIDE

sudo -u postgres createuser userside -P
sudo -u postgres createdb -e -E "UTF-8" -l "uk_UA.UTF-8" -O userside -T template0 userside
sudo -u postgres psql -d userside -c "CREATE EXTENSION postgis"

If your PostgreSQL is installed on another server, you will need to make adjustments to the postgresql.conf and pg_hba.conf files located in /etc/postgresql/14/main/. In postgresql.conf you need to uncomment and change the value of listen_addresses parameter, specifying there all IP addresses of server interfaces where it can accept connections to PostgreSQL. In the pg_hba.conf file, add a line at the very end, similar to the previous ones, indicating from which address the user of ERP USERSIDE can connect. But if your PostgreSQL is on the same server as PHP and everything else, there is no need to make any adjustments to this file.

PostgreSQL server fine-tuning

Refer to Fine tuning.

Redis

Alternative installation method

The standard Debian 10 repository includes version 5.0.3 of Redis, released in December 2018. This version is suitable for ERP USERSIDE operation. If you want to install the latest version from branch 6, you will have to build Redis manually. If you have no experience with this, simply install Redis as shown below - that's quite enough. If you are using an Ubuntu server, you can use the official PPA-repository.

For information on manually building Redis and on the PPA repository, see official Redis website.

Installation

sudo apt install -y redis-server

Setting

By default Redis accepts connections without a password, but we strongly recommend setting a password. Since the password is transmitted openly (Redis does not provide encryption as it focuses on query speed and extra steps like encryption do not apply), you need to create a really long and complex password. This can be done, for example, using the sha256sum utility as follows:

echo "some unique long phrase" | sha256sum

The output will be a sha256 hash, which you will use as your real password. Next, instead of MYPASSWORDHERE, use this particular password. Make a note of it.

Specify this password in the Redis configuration file:

sudo sed -i 's@^.*requirepass .*@requirepass MYPASSWORDHERE@g' /etc/redis/redis.conf

where MYPASSWORDHERE is your Redis password.

Timeout must also be disabled (on some versions of Redis it is enabled):

sudo sed -i 's@^timeout .*@timeout 0@' /etc/redis/redis.conf

Restart Redis and make sure, that it works (should get PONG in response):

sudo systemctl restart redis
redis-cli -h 127.0.0.1 -p 6379 -a MYPASSWORDHERE ping