Comments on How to Install Mautic Marketing Automation Tool on Ubuntu 20.04
Mautic is an open source self-hosted marketing automation tool for everyone. You can use it to grow up your business, monitor your website, create landing pages, create campaign for your business, manage contacts, and even send marketing emails.
7 Comment(s)
Comments
Thank you for the Tutorial.
There was a problem I had. So maybe someone else is stuck at the same point:
Every time I tried to finish Step 2 "Mautic Installation - Administrative User" I got a Error 500.
The Problem is the not existing cache of Mautic. There is one missing file. I had to warm up the cache before.
Solution:
sudo su
cd /var/www/mautic/app
rm -rf cache/*
./console cache:warmup
Can Mautic be installed to run on an Ubuntu 18.04 LTS server using the ISPconfig.org control panel?
@IzFazT That´s why it is always good to read the comments. And sometimes the tutorial get´s a update. As you can see above.
@peterpetr Yes you can do so. Your config is exactly what I use. You just have to start from Chapter 5 within your desired domain or subdomain.
After I created new database and a subdomain marketing.dein-domain-name.de in ISPConfig with PHP-FPM7.3, LetsEncrypt SSL, Rewrite HTTP to HTTPS, use HTTP2, I exctracted the downloaded latest stable version (actually it is 2.16.3) of mautic to /var/www/marketing.dein-domain-name.de/web/mautic.
For individual php.ini I used:
cgi.fix_pathinfo = 0
date.timezone = "Europe/Berlin"
For nginx directives I used:
##subroot mautic ## # Include Header configuration #include /etc/nginx/snippets/header.conf; # Include SSL configuration #include /etc/nginx/snippets/ssl.conf; client_max_body_size 20M; location / { # try to serve file directly, fallback to app.php try_files $uri /index.php$is_args$args; } location ~ /(mtc.js|1.js|mtracking.gif|.*\.gif|mtc) { # default_type "application/javascript"; try_files $uri /index.php$is_args$args; } # redirect some entire folders rewrite ^/(vendor|translations|build)/.* /index.php break; location ~ \.php$ { include snippets/fastcgi-php.conf; {FASTCGIPASS} } location ~* ^/index.php { # try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini {FASTCGIPASS} fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_buffer_size 128k; fastcgi_buffers 256 16k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } # Deny everything else in /app folder except Assets folder in bundles location ~ /app/bundles/.*/Assets/ { allow all; access_log off; } location ~ /app/ { deny all; } # Deny everything else in /addons or /plugins folder except Assets folder in bundles location ~ /(addons|plugins)/.*/Assets/ { allow all; access_log off; } # location ~ /(addons|plugins)/ { deny all; } # Deny all php files in themes folder location ~* ^/themes/(.*)\.php { deny all; } # Don't log favicon location = /favicon.ico { log_not_found off; access_log off; } # Don't log robots location = /robots.txt { access_log off; log_not_found off; } # Deny yml, twig, markdown, init file access location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ { deny all; access_log off; log_not_found off; } # Deny all attempts to access hidden files/folders such as .htaccess, .htpasswd, .DS_Store (Mac), etc... location ~ /\. { deny all; access_log off; log_not_found off; } # Deny all grunt, composer files location ~* (Gruntfile|package|composer)\.(js|json)$ { deny all; access_log off; log_not_found off; } # Deny access to any files with a .php extension in the uploads directory location ~* /(?:uploads|files)/.*\.php$ { deny all; } # A long browser cache lifetime can speed up repeat visits to your page location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ { access_log off; log_not_found off; expires 360d; }
In my used config there are some modifications for ssl and header config, for more security, that I did not post above. I hope everyone here using ISPConfig knows how to secure your sites. I use some snippets for that, which I include via "include". That´s why i commented them out.
My above nginx config (I found on another site for installing mautic) works and I think it restricts some bad behavior a little better than the config of Muhammad Arul. But the one from Muhammad also works with ISPConfig if you modify it a little bit:
client_max_body_size 4M; client_body_buffer_size 128k; location / { try_files $uri $uri/ =404; } location ~ .php$ { include snippets/fastcgi-php.conf; {FASTCGIPASS} } location ~* ^/index.php { fastcgi_split_path_info ^(.+.php)(/.+)$; {FASTCGIPASS} fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_buffer_size 128k; fastcgi_buffers 256 16k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; }
Both configs don´t work perfectly so far for me. If you installed the latest stable version of mautic you get a info within mautic that there is a new version of mautic available (v3.0.1) If you click the button "update now", the nginx vhost sends you to marketing.dein-domain-name.de/index.php/upgrade_v3.php and you get a 404. The index.php/ part in it is wrong. It only has to be marketing.dein-domain-name.de/upgrade_v3.php to use it. It works if you change the adress manually. I think it is because I can´t write the nginx vhost by myself. I always need someone like howtoforge and others who writes the config. With that I understand what it does or what it restricts. So if there is someone who can help please post it here.
By the way if you installed v3.x.x you have to use bin/console instead of app/console. With version 3 the mautic developers changed it that way.
Sorry for this strange looking comment from me before. When I wrote it it looked much better and readable.
It isn´t a good idea to copy and paste code-blocks from the tutorial and use them for a comment. It looks perfect when you write it but it becomes unreadable when it is published.
So maybe someone can delete the code-blocks from my comment before. Because I think this is only confusing.
Thanks alot for the tutorial, it worked perfectly well for me, the only major challenge I had was after the installation, I was getting this error message in the browser "The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator." - from research I had to run this cmd to fix it, chown -R www-data /var/www/mautic/ solve the problem.
FYI:
This commmand did not work for me.
unzip -qq latest -d mautic
i get this?
root@mautic:/var/www# unzip -qq latest -d mautic
[latest]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of latest or
latest.zip, and cannot find latest.ZIP, period.
Can Mautic be managed using ISPconfig?