ALB Sticky Sessions or a working MATOMO_GENERAL_SALT ? Containerized environment

Hi, I’ve got Matomo configured completely headless inside a docker container that runs on AWS ECS with an AWS Application load balancer in front of it. I’m running two containers in a load balanced environment. Hopefully more some day.

I was consistently giving me errors logging in until I learned that config.ini.php were not the same. The differing line was the “salt”. So I ssh’d thru my bastion, to my ECS host, and used docker exec to get a bash prompt. Then with a bit of finagling I was able to make both salts the same. After that the errors went away, terrific.

With more reading, I learned that Matomo has a convention where you can create ENV Vars of the pattern MATOMO_$CONFIG-SECTION_$CONFIG-PARAMETER, so I was hopeful that I could create MATOMO_GENERAL_SALT with a long secret string and have the same salt on all instances.

I tried this. It didn’t set them the same. :(. Can someone help me understand what order stuff like this gets set in, and why it might not have been set?

Soo, if that doesn’t work, or isn’t supposed to work, my next option is to enable sticky sessions in the ALB listener rule which “should work” but I want to ask you folks before I go about doing that.

Advice? Thanks.

Hi Jeff, later this year we’ll publish some doc on the website.
on AWS, you would typically use the following services:

  • EC2 instances for the web application servers running PHP and the web server:
    • The default “aws linux ami” can be used.
    • PHP Can be installed with a command such as:
      amazon-linux-extras install -y php7.2
      yum install -y php-gd php-xml php-mbstring php-opcache php-soap
  • RDS for database, using either:
    • MySQL (eg. db.t3.xlarge for a few million pageviews per month)
    • or Aurora (eg. db.m5.xlarge for a few million pageviews per month)
  • EFS to synchronise the following files and folders:
    • /config/ - the folder that includes the config.ini.php file*
    • /misc/user/ - stores custom logo and favicon that may be uploaded*
    • /js/ - stores the JS tracker files and also the tag manager container files*
    • Also backup your EFS content by following the guide.
  • Cloudwatch & Log rotate:
    • Cloudwatch can be configured to receive all your log files.
    • A retention date can also be configured for each logs.
    • Then you must still setup log rotate on the servers to rotate the logs and delete these logs eventually from the servers.

Does this help?
have you got other issues after following the steps above?

2 Likes