Installing Akeneo on Google Cloud
Wow this was a fun one!
Testing with Bitnami
I installed a Bitnami package on a new Google Cloud instance to test Akeneo. Once I had bought and installed a Shopify connection and imported some products I decided that this was the PIM I wanted to use.
I already had a SQL server, elasticsearch and a nginx web server so I wanted to reuse those to also host Akeneo, rather than run its own instance. The requirements are quite high at 8GB ram due elasticsearch and nodejs so it's an expensive server for something that will be used intermittently but needs to be always available.
I tried running it on a e2-micro and e2-medium and both crapped out.
Installing Akeneo from Scratch
First I did the classic skim-read the docs and then crack on. This was a mistake as I missed a couple of requirements :-)
Not Docker
I didn't want to run a docker container as I already had nginx, php, elasticsearch services running.
PHP
I had to downgrade the server (yay this was a production server) to PHP8.0 as 8.1 was not supported. No matter how many hours I wasted.
Nodejs
Version 17 of Nodejs doesn't work, I had to downgrade to 16.
Crazy env overwrite
During the install it seems the custom .env file would be overwritten, causing the database connection and elasticsearch to fail.
I cp
a working copy of the .env file a couple of times during the install to make sure it stuck.
Daemon agent
Do install this. The install guide tells you to, I'm not sure while I felt I didn't need to bother with this step :-)
I installed and used Supervisor as it looked a lot simpler than systemd. Also everyone hates systemd 💩.
Nginx config
Nothing special was needed here (I think) apart from upping client_max_body_size
so I could upload bigger files.
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/ssl/domain.pem;
ssl_certificate_key /etc/ssl/domain.key;
server_name domain.com;
root /var/www/akeneo/public;
index index.php index.html;
location / {
try_files $uri /index.php?$query_string;
client_max_body_size 128M;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
}
}
Clearing the elasticsearch database
When I migrated from the Bitnami server I needed to reindex but struggled to find documentation.
bin/console akeneo:elasticsearch:reset-indexes --index=akeneo_pim_product_and_product_model
bin/console pim:product-model:index --all
bin/console pim:product:index --all
bin/console cache:clear
Setup up SMTP / email
I had already enabled SMTP reply in Google Workspace for this IP
Apps > Google Workspace > Settings for Gmail > Routing
Then in .env set the MAILER_URL as
MAILER_URL=smtp://smtp-relay.gmail.com:465?encryption=ssl&[email protected]