System installation on Debian 10 (Buster)¶
Here is a quick guide to set up the System Requirements manually on Debian 10. This guide will help you to install all the packages and modules needed for Akeneo PIM on a freshly installed Debian 10 system and then configure the application to match your local installation.
Warning
Please perform the following commands as root.
System installation¶
MySQL 8.0¶
The easiest way to install MySQL 8.0 is to use the official vendor package.
Follow the official documentation: <https://dev.mysql.com/doc/refman/8.0/en/linux-installation-debian.html>.
Download the bundle package for the required version:
# wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_8.0.22-1debian10_amd64.deb-bundle.tar
And follow the aforementioned documentation.
When installing MySQL 8.0, you’ll have to choose the authentication method. Please select Use Legacy Authentication Method as the Strong Password Encryption is not yet supported by Akeneo PIM.
PHP 7.4¶
As Debian 10 only provides PHP 7.3, we need to use Ondrej Sury packages to install PHP 7.4..
# wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
# sh -c 'echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list'
# apt-get update
Install PHP and the required extensions:
# apt-get install php7.4-cli php7.4-apcu php7.4-bcmath php7.4-curl php7.4-opcache php7.4-fpm php7.4-gd php7.4-intl php7.4-memcached php7.4-mysql php7.4-xml php7.4-zip php7.4-mbstring php7.4-imagick php7.4-exif
Elasticsearch 7.10¶
Follow the official Elasticsearch documentation: official vendor package:
first install the PGP key
then install the package via the official repository
# apt-get install apt-transport-https
# wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
# echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list
# apt update && apt-get install elasticsearch
# service elasticsearch start
Warning
You will probably need to increase the MAX_MAP_COUNT Linux kernel setting. Proceed as follow (first command will affect your current session, second one every boot of your machine):
# sysctl -w vm.max_map_count=262144
# echo "vm.max_map_count=262144" | tee /etc/sysctl.d/elasticsearch.conf
# service elasticsearch restart
Apache¶
# apt-get install apache2
# a2enmod rewrite proxy_fcgi
# service apache2 restart
Note
If you migrate from Apache with mod_php, don’t forget to deactivate it by running the following commands
# a2dismod php5
System configuration¶
You now have a system with the right versions of Apache, PHP, MySQL and Elasticsearch. The next step is to configure them to be able to run an Akeneo PIM instance.
MySQL¶
Create a dedicated MySQL database and a dedicated user (called akeneo_pim) for the application
$ mysql -u root -p
mysql> CREATE DATABASE akeneo_pim;
mysql> CREATE USER akeneo_pim@localhost IDENTIFIED WITH mysql_native_password BY 'akeneo_pim';
mysql> GRANT ALL PRIVILEGES ON akeneo_pim.* TO akeneo_pim@localhost;
mysql> EXIT
PHP¶
Setup CLI php.ini file
/etc/php/7.4/cli/php.ini
$ sudo vim /etc/php/7.4/cli/php.ini
memory_limit = 1024M
date.timezone = UTC
Note
Use the time zone matching your location, for example America/Los_Angeles or Europe/Berlin. See https://www.php.net/timezones for the list of all available timezones.
Setup FPM php.ini file
/etc/php/7.4/fpm/php.ini
Note
If you have several PHP versions on your server, these files can be located in /etc/php/x.x/fpm/php.ini
and /etc/php/x.x/cli/php.ini
.
$ sudo vim /etc/php/7.4/fpm/php.ini
memory_limit = 512M
date.timezone = UTC
To avoid spending too much time on permission problems between the CLI user and the FPM user, a good practice is to use the same user for both of them.
Warning
This configuration is aimed to easily set up a development machine. It is absolutely not suited for a production environment.
Get your identifiers
$ id
uid=1000(my_user), gid=1000(my_group), ...
In this example, the user is my_user and the group is my_group.
Stop FPM
$ sudo service php7.4-fpm stop
Open the file
/etc/php/7.4/fpm/pool.d/www.conf
with your favorite text editor:
$ sudo vi /etc/php/7.4/fpm/pool.d/www.conf
# replace these environment variables:
user = my_user
group = my_group
listen = /run/php/php7.4-fpm.sock
listen.owner = www-data
listen.group = www-data
Note
On the default installation, FPM user and group are www-data
.
listen.owner
and listen.group
must be set on the same user than your Apache server.
/run/php/php7.4-fpm.sock
is the default socket path. If you changed it in /etc/php/7.4/fpm/pool.d/www.conf
, change it in the Apache virtual host too.
Restart FPM
$ sudo service php7.4-fpm restart
Elasticsearch¶
Depending on the volume of data, it can be interesting to tweak the amount of memory usable by the JVM, as recommended by the official documentation.
Usually, this configuration lies in the file /etc/elasticsearch/jvm.options
.
Apache¶
Creating the virtual host file¶
The next step is to create a virtual host for Apache to point to the installation folder of the Akeneo PIM.
First, create the file /etc/apache2/sites-available/akeneo-pim.local.conf
1<VirtualHost *:80>
2 ServerName akeneo-pim.local
3
4 DocumentRoot /path/to/installation/pim-community-standard/public
5 <Directory /path/to/installation/pim-community-standard/public>
6 AllowOverride None
7 Require all granted
8
9 Options -MultiViews
10 RewriteEngine On
11 RewriteCond %{REQUEST_FILENAME} !-f
12 RewriteRule ^(.*)$ index.php [QSA,L]
13 </Directory>
14
15 <Directory /path/to/installation/pim-community-standard/public/bundles>
16 RewriteEngine Off
17 </Directory>
18
19 <FilesMatch \.php$>
20 SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost/"
21 </FilesMatch>
22
23 SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
24
25 ErrorLog ${APACHE_LOG_DIR}/akeneo-pim_error.log
26 LogLevel warn
27 CustomLog ${APACHE_LOG_DIR}/akeneo-pim_access.log combined
28</VirtualHost>
Note
Replace
/path/to/installation
by the path to the directory where you want to install the PIM.Replace
pim-community-standard
bypim-enterprise-standard
for enterprise edition./run/php/php7.4-fpm.sock
is the default socket path. If you changed it in/etc/php/7.4/fpm/pool.d/www.conf
, change it in the virtual host too.Don’t forget to add the
web
directory of your Symfony application.
Enabling the virtual host¶
The Apache configuration is done, you need to enable it:
$ sudo apache2ctl configtest
# This will return 'Syntax OK'
$ sudo a2ensite akeneo-pim.local
$ sudo service apache2 reload
Adding the virtual host name¶
The last step is to edit the file /etc/hosts
and add the following line:
127.0.0.1 akeneo-pim.local
Node 12¶
$ apt-get install curl
$ curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
$ bash nodesource_setup.sh
$ apt-get install -y nodejs
To check which version of Node.js you have installed after these initial steps, type:
$ nodejs -v
Yarn¶
$ curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
$ apt update && apt-get install yarn
Found a typo or a hole in the documentation and feel like contributing?
Join us on Github!