System install on Debian 8 Jessie

Here is a quick guide to set up the System Requirements on Debian 8 Jessie.

Note

Please perform the following commands as root.

System installation

Base dependencies

$ apt-get update
$ apt-get install mysql-server apache2 libapache2-mod-php5 php5-cli php5-apcu php5-mcrypt php5-intl php5-mysql php5-curl php5-gd
$ php5enmod mcrypt
$ a2enmod rewrite

Note

PHP 5.6 provided in Debian 8 Jessie comes with the Zend OPcache opcode cache. Only the data cache provided by APCu is needed.

Choosing the product storage

Depending on your data volume (number of products, number of attributes per product, number of basic, localized or scopable attributes, number of locales, number of scopes, etc.) you will have to choose a strategy to store your products, which will determine your database server configurations:

  • Full SQL database with MySQL. All your data will be stored in MySQL.
  • Hybrid SQL storage with MySQL and MongoDB. Your product related data will be stored in MongoDB. The other data will still remain in MySQL.

To make an educated choice you should try to find out how many product values your database will store. For example, for one product:

  • A simple attribute will generate only one product value
  • A localized attribute will generate as many product values as you have locales enabled
  • A scopable attribute will generate as many product values as you have channels
  • A localizable and scopable attribute will generate: (number of enabled locales * number of channels) product values

We consider that MySQL can store up to 5 million product values. Here is the complete formula to check if you have more product values than the recommended threshold that MySQL can manage alone:

N products * (
    N simple attributes
    + ( N localized attributes * N enabled locales )
    + ( N scopable attributes * N existing channels )
    + ( N scopable AND localizable attributes * N enabled locales * N existing channels )
) > 5 Million

Based on this formula, either you need Installing MongoDB, either you can directly go to the System configuration section.

Installing MongoDB

  • Install MongoDB server
$ apt-get update
$ apt-get install mongodb

Note

Akeneo PIM will not work with MongoDB 3.*. The supported versions are 2.4 and 2.6.

  • Install MongoDB PHP driver
$ apt-get install php5-mongo

System configuration

You now have a system with the right versions of Apache, PHP and MySQL. 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> GRANT ALL PRIVILEGES ON akeneo_pim.* TO akeneo_pim@localhost IDENTIFIED BY 'akeneo_pim';
mysql> EXIT

PHP

  • Setup Apache php.ini file /etc/php5/apache2/php.ini

Note

If you have several php versions on your server, these files can be located in /etc/php/x.x/apache2/php.ini and /etc/php/x.x/cli/php.ini.

$ sudo vim /etc/php5/apache2/php.ini
memory_limit = 512M
date.timezone = Etc/UTC
  • Setup CLI php.ini file /etc/php5/cli/php.ini
$ sudo vim /etc/php5/cli/php.ini
memory_limit = 768M
date.timezone = Etc/UTC

Note

Use the time zone matching your location, for example America/Los_Angeles or Europe/Berlin. See http://www.php.net/timezones for the list of all available timezones.

Apache

Setting up the permissions

To avoid spending too much time on permission problems between the CLI user and the Apache 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 Apache
$ sudo service apache2 stop
  • Open this file /etc/apache2/envvars with your favorite text editor:
$ sudo vi /etc/apache2/envvars
# replace these environment variables:
export APACHE_RUN_USER=my_user
export APACHE_RUN_GROUP=my_group

$ sudo chown -R my_user /var/lock/apache2

Note

On the default installation, Apache run user and Apache run group are www-data. You have to replace these variables:

  • APACHE_RUN_USER=www-data by APACHE_RUN_USER=my_user
  • APACHE_RUN_GROUP=www-data by APACHE_RUN_GROUP=my_group
  • Restart Apache
$ sudo service apache2 start

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
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<VirtualHost *:80>
    ServerName akeneo-pim.local

    DocumentRoot /path/to/installation/pim-community-standard/web/
    <Directory /path/to/installation/pim-community-standard/web/>
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/akeneo-pim_error.log

    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/akeneo-pim_access.log combined
</VirtualHost>

Note

  • Replace /path/to/installation by the path to the directory where you want to install the PIM.
  • Replace pim-community-standard by pim-enterprise-standard for enterprise edition.
  • 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