Setup System Requirements on Ubuntu 14.04¶
Here is a quick guide to setup the System Requirements on Ubuntu 14.04.
System installation¶
Base dependencies¶
1 2 3 4 5 6 7 8 | $ sudo apt-get update
$ sudo apt-get install mysql-server
$ sudo apt-get install apache2
$ sudo apt-get install libapache2-mod-php5 php5-cli
$ sudo apt-get install php5-mysql php5-intl php5-curl php5-gd php5-mcrypt
$ sudo php5enmod mcrypt
$ sudo a2enmod rewrite
$ sudo apt-get install php5-apcu
|
Note
PHP 5.5 provided in Ubuntu 14.04 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
1 2 | $ sudo apt-get update
$ sudo apt-get install mongodb
|
Note
Akeneo PIM will not work with MongoDB 3.*. The supported version are 2.4 and 2.6.
- Install MongoDB PHP driver
1 | $ sudo apt-get install php5-mongo
|
System configuration¶
MySQL¶
- Create a MySQL database and a user for the application
1 2 3 4 | $ 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
memory_limit = 512M
date.timezone = Etc/UTC
- Setup CLI php.ini file
/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, an easy configuration is to use the same user for both processes.
- Get your identifiers
1 2 | $ 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
1 | $ sudo service apache2 stop
|
- Open this file
/etc/apache2/envvars
with your favorite text editor:
1 2 3 4 5 6 | $ sudo gedit /etc/apache2/envvars
# replace the 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
byAPACHE_RUN_USER=my_user
APACHE_RUN_GROUP=www-data
byAPACHE_RUN_GROUP=my_group
- Restart Apache
1 | $ sudo service apache2 start
|
Creating the virtual host file¶
Create the file /etc/apache2/sites-available/akeneo-pim.local.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <VirtualHost *:80>
ServerName akeneo-pim.local
DocumentRoot /path/to/installation/pim-community-standard/web/
<Directory /path/to/installation/pim-community-standard/web/>
Options Indexes FollowSymLinks MultiViews
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>
|
Enabling the virtual host¶
1 2 3 4 | $ cd /etc/apache2/sites-available/
$ sudo a2ensite akeneo-pim.local
$ sudo apache2ctl -t
$ sudo service apache2 reload
|
Adding the virtual host name¶
Edit the file /etc/hosts
and add the following line
1 | 127.0.0.1 akeneo-pim.local
|