The installation process for Mautic in a self-hosted environment is not overly complicated. We had to make some changes to ensure it worked and was secure enough for testing purposes to install the Mautic on a LAMP static there is a great how-to provided by the MauTeam we made some changes throughout the process. The MauTeam gave a great foundation, but we wanted to do further testing, including locking down the applications LAMP. Below is a reference to the changes we made throughout the installation.
PHP Versions
Mautic 3 currently does not use PHP 8, which is installed default after the section where PHP 7.3 was installed (Now we are ready to install all the required packages:). We had to change the version of PHP the operating system used by using the following method.
Apache:- sudo a2dismod php8.0 sudo a2enmod php7.3 sudo service apache2 restart Command Line:- sudo update-alternatives --set php /usr/bin/php7.3 sudo update-alternatives --set phar /usr/bin/phar7.3 sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.3 sudo update-alternatives --set phpize /usr/bin/phpize7.3 sudo update-alternatives --set php-config /usr/bin/php-config7.3
Hardening Apache an SSL installation
Install an SSL certificate to ensure encrypted communication for the users when using the application following an excellent article provided by Digital ocean that discusses lets encrypted.
Also, there is a fantastic article here to protect Apache to ensure that it was hardened for different sorts of attacks. It explains what to do a why a team should implement these changes.
Securing Mysql
The installation process shows you how to set up MariaDB by setting up a secured version of this software package. Using root in the installation is acceptable for testing software that is not public-facing, but it would not work in our circumstances. We, the Mauteam discuss the structure of the database. We implemented this article first and created a user that was not Root to make the database connection to Mautic.
Browser recommendations
Three items showed on my suggested recommendations
- The date.timezone setting is not set in your PHP configuration. Mautic has set the default timezone to 'UTC', but we suggest putting this in your PHP configuration.
- The memory_limit setting in your PHP configuration is lower than the suggested minimum limit of 512M. Mautic can have performance issues with large datasets without sufficient memory.
PHP date.zone and PHP memory limit can be fixed by altering the PHP.ini (ubuntu default is /etc/php/7.3/apache2/php.ini in this circumstance) file from the command line. To change the date.zone you are looking for the following reference
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone ;date.timezone =
Then change it to the time zone of your choice. You can find a list of time zones here.
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = "melbourne/australia"
For the PHP memory_limit, the recommended minimum is 512MB, and there is a tendency to add more memory. Believing that the increase above the minimum will create a tremendously positive effect on the application. However, this only reduces the number of PHP processes available to the system and can cause PHP skipping,
; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 128M
Change the memory_limit to the following.
; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 512M