I’ve searched a lot to know how to install Mautic on EE in a subdomain. Following steps is what works for me (Ubuntu 16.04/Debian 8 | Mautic v2.9.0). Hope it help.
1. Create a subdomain with SSL (let’sEncrypt recently does not support wildcard SSL, wait til Jan 2018):
ee site create mautic.domain.com --mysql --le
REMEMBER to note down: database name, user & password.
2. Get to the folder and download Mautic:
cd /var/www/mautic.domain.com/htdocs/
wget https://s3.amazonaws.com/mautic/releases/2.9.0.zip
3. Unzip and delete zipped files:
unzip 2.9.0.zip
rm 2.9.0.zip
if upzip is not installed, execute this command first:
apt install unzip
4. Change owner of the folder:
chown -R www-data:www-data .
chmod -R g+rw .
5. Configuration for the site:
- Edit file (Select all > Delete > Paste):
/etc/nginx/sites-available/mautic.domain.com
-
With the following code:
server {
listen 80;
listen [::]:80;
server_name mautic.domain.com www.mautic.domain.com;
access_log /var/log/nginx/mautic.domain.com.access.log rt_cache;
error_log /var/log/nginx/mautic.domain.com.error.log;
root /var/www/mautic.domain.com/htdocs;
index index.php index.html index.htm;
charset utf-8;
# redirect index.php to root
rewrite ^/index.php/(.*) /$1 permanent;
# redirect some entire folders
rewrite ^/(vendor|translations|build)/.* /index.php break;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass php;
}
# 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;
}
include /var/www/mautic.domain.com/conf/nginx/*.conf;
}
6. Edit php.ini file in:
/etc/php/5.6/fpm/php.ini
Add the following line to the PHP configuration section:
always_populate_raw_post_data = -1
7. Restart the stack:
ee stack restart
8. Access mautic.domain.com to complete the installation process.
You may have to create/sign up/… SMTP server before the installation process.
9. Enjoy!