(This is the guide modified, it worked for me)
How to install Akeneo PIM for testing/dev inUbuntu 20.04 LTS (my way)
Change localhost name (optional):
sudo nano /etc/hosts
(add this or modify)
127.0.0.1 localhost
127.0.0.1 akeneo-pim.local
Install apache2 and modules:
sudo apt install apache2 curl aspell php-apcu-bc php-pear php-apcu php7.4-fpm php7.4 libapache2-mod-php7.4 php7.4-cli php7.4-common php7.4-xml php7.4-mysql php7.4-gd php-imagick php7.4-tidy php7.4-xmlrpc php7.4-curl php7.4-mbstring php7.4-zip php7.4-soap php7.4-bcmath php7.4-intl php7.4-xsl php7.4-json zip unzip --install-recommends
(modify both php.ini)
sudo nano /etc/php/7.4/cli/php.ini
sudo nano /etc/php/7.4/fpm/php.ini
memory_limit = 2G
date.timezone = America/New_York
apc.enable_cli = 1
a2enmod rewrite proxy_fcgi
sudo nano /etc/php/7.4/fpm/pool.d/www.conf
user = www-data
group = www-data
listen = /run/php/php7.4-fpm.sock
listen.owner = www-data
listen.group = www-data
## Optional: this can help to optimize if you have little memory in your virtual machine.
# pm = ondemand
# pm.max_children = 80
# pm.process_idle_timeout = 10s
# pm.max_requests = 200
sudo service apache2 restart
sudo service php7.4-fpm restart
Add the Akeneo site to web server:
sudo mv /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf.bak
sudo nano /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerName akeneo-pim.local
DocumentRoot /var/www/html/public
<Directory /var/www/html/public>
AllowOverride None
Require all granted
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
<Directory /var/www/html/public/bundles>
RewriteEngine Off
</Directory>
<FilesMatch .php$>
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost/"
</FilesMatch>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
ErrorLog ${APACHE_LOG_DIR}/akeneo-pim_error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/akeneo-pim_access.log combined
</VirtualHost>
Test if everything is working in the config (you might get some warning that will solve later)
sudo apache2ctl configtest
sudo service apache2 restart
Install Mysql, create db/user:
sudo apt install mysql-server mysql-client --install-recommends
(Install phpmyadmin if you like):
sudo apt install phpmyadmin --install-recommends
Create DB and user:
sudo mysql -u root -p
CREATE DATABASE akeneo_pim;
CREATE USER akeneo_pim@localhost IDENTIFIED WITH mysql_native_password BY 'akeneo-pim';
GRANT ALL PRIVILEGES ON akeneo_pim.* TO akeneo_pim@localhost;
FLUSH PRIVILEGES;
EXIT
Configure root with password (optional):
GRANT ALL PRIVILEGES ON *.* TO root@localhost;
FLUSH PRIVILEGES;
EXIT;
Add other users as root (optional):
CREATE USER 'youruser'@'localhost' IDENTIFIED BY 'CFKLDLNA';
GRANT ALL PRIVILEGES ON *.* TO youruser@localhost;
FLUSH PRIVILEGES;
EXIT;
Install JDK and ElasticSearch:
sudo apt install -y openjdk-11-jdk --install-recommends
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
sudo apt update
sudo apt install elasticsearch
Options to limit memory usage (test as you need)
sudo nano /etc/elasticsearch/jvm.options.d/jvm.options
-Xms2g
-Xmx2g
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo service elasticsearch start
If Elasticsearch wont start at boot, give it little more timeout wait:
sudo mkdir /etc/systemd/system/elasticsearch.service.d
echo -e "[Service]nTimeoutStartSec=250" | sudo tee /etc/systemd/system/elasticsearch.service.d/startup-timeout.conf
sudo systemctl show elasticsearch | grep ^Timeout
Options for Akeneo:
sudo sysctl -w vm.max_map_count=262144
sudo nano /etc/sysctl.d/elasticsearch.conf
vm.max_map_count=262144
sudo service elasticsearch restart
Install NODE12:
cd ~
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install -y nodejs
Install YARN:
cd ~
wget https://dl.yarnpkg.com/debian/pubkey.gpg
sudo apt-key add pubkey.gpg
sudo nano /etc/apt/sources.list.d/yarn.list
deb https://dl.yarnpkg.com/debian/ stable main
sudo apt update && sudo apt install yarn
Install Composer:
cd ~
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
Install Akeneo-PIM:
sudo rm /var/www/html/*
(Must be an empty folder)
cd /var/www/html
sudo chown -R $USER:$USER /var/www/html
php -d memory_limit=4G /usr/local/bin/composer create-project --prefer-dist akeneo/pim-community-standard . "5.0.*@stable"
(accept allow-plugins)
Config .env as you need to match what you enter before:
nano /var/www/html/.env.local
APP_ENV=prod
APP_DATABASE_HOST=localhost
APP_DATABASE_PORT=null
APP_DATABASE_NAME=akeneo_pim
APP_DATABASE_USER=akeneo_pim
APP_DATABASE_PASSWORD=akeneo_pim
APP_INDEX_HOSTS='localhost:9200'
Start installation in production mode:
(install this if you need: sudo apt make gcc)
cd /var/www/html
NO_DOCKER=true make prod
sudo chown -R www-data:www-data /var/www/html
sudo chmod ug+rw /var/www/html/var/cache /var/www/html/var/logs /var/www/html/public
Create an admin user:
cd /var/www/html
sudo -u www-data php bin/console pim:user:create
User/Pass: youruser/CFKLDLNA
Cron job for Akeneo:
sudo -u www-data /usr/bin/php /var/www/html/bin/console akeneo:batch:job-queue-consumer-daemon --env=prod -vvv >>/var/www/html/var/logs/daemon_logs.log 2>&1
2
Answers
I could solve the problem.
The official manual install guide tells you to create a new virtualhost on port *:80 called /etc/apache2/sites-available/akeneo-pim.local.conf
And then enable it with a2ensite. If you do so, you will also have 000-default.conf enabled as it comes defaulted enabled with apache.
So, you have to replace the 000-default.conf contents with whats is in the guide here
Then restart apache and it works, but in port 80 (not in por 8080 as told in the guide, think that is just for docker)
Also you need to create a new user/pass as the admin/admin is just for docker install, you can create user with this command ran in your document-root akeneo folder. You have to run it with the same user that runs apache and the document-root akeneo directory permissions (if not it will give cant write/access errors)
In my case apache and php7.4-fpm runs with www-data as the permissions in /var/www/html/ (my documentroot where akeneo CE is installed)
So to add user: cd /var/www/html sudo -u www-data php bin/console pim:user:create
Hope it helps, will try to add the clean guide if it helps someone else, or just ask, will help if I can.
That is an apache misconfiguration. If you do not use the docker-setup you will have no 8080 unless configured. The guide goes for the docker, if you do not use it you need to adapt the config yourself.
The
{pim-install}/public
folder is the main entry point where your apache config points to just{pim-install}
. Adapt the host-configuration and you are fine. See this part: https://docs.akeneo.com/latest/install_pim/manual/system_requirements/system_install_ubuntu_2004.html#id1Where the Document-Root points to
.../public
The routing will handle the other calls (like for
bundles/...
).