Mudanças entre as edições de "Mautic"

De MochilaWiki
Ir para navegaçãoIr para pesquisar
m (conf nginx)
Linha 28: Linha 28:
 
sudo sed -i 's#;cgi.fix_pathinfo=1#cgi.fix_pathinfo = 0#g' /etc/php/7.0/fpm/php.ini
 
sudo sed -i 's#;cgi.fix_pathinfo=1#cgi.fix_pathinfo = 0#g' /etc/php/7.0/fpm/php.ini
 
</source>
 
</source>
 +
 +
== Configuração no Nginx ==
 +
 +
em /etc/nginx/sites-available/mautic
 +
 +
<source lang="nginx">
 +
server {
 +
    listen 80;
 +
 +
server_name  quijaua.net www.quijaua.net;
 +
 +
root /var/www/html/mautic;
 +
 +
 +
    index index.html index.htm index.php;
 +
    error_page 404 /index.php;
 +
 +
    access_log /var/log/nginx/access.log;
 +
    error_log  /var/log/nginx/error.log error;
 +
 +
    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 / {
 +
# First attempt to serve request as file, then
 +
# as directory, then fall back to index.html
 +
        # one option: try_files $uri $uri/ /index.php$is_args$args;
 +
        try_files $uri /index.php$is_args$args;
 +
# Uncomment to enable naxsi on this location
 +
# include /etc/nginx/naxsi.rules
 +
}
 +
 +
    # 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;
 +
    }
 +
 +
    #######################################
 +
    ##  End Mautic Specific config #####
 +
    #######################################
 +
 +
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
 +
#
 +
    location ~ \.php$ {
 +
        # try_files $uri =403;
 +
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
 +
        # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
 +
 +
              include snippets/fastcgi-php.conf;
 +
              fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
 +
 +
#        fastcgi_pass unix:/var/run/php5-fpm.sock;
 +
#        fastcgi_index index.php;
 +
        include fastcgi_params;
 +
 +
        fastcgi_buffer_size 128k;
 +
        fastcgi_buffers 256 16k;
 +
        fastcgi_busy_buffers_size 256k;
 +
        fastcgi_temp_file_write_size 256k;
 +
    }
 +
}
 +
</source>
 +
  
  

Edição das 23h19min de 6 de maio de 2018

Página do projeto

Instalação do Mautic em Ubuntu 16.04

Instalando dependências

sudo apt-get install nginx mariadb-server php7.0-fpm php7.0-xml \
unzip php7.0-imap php7.0-intl php7.0-zip php7.0-mcrypt php7.0-mysql \
php7.0-curl php7.0-mbstring php7.0-gd

Ajustes no PHP

É necessário ajustar:

memory_limit = 256M
upload_max_filesize = 64M
max_execution_time = 360
cgi.fix_pathinfo = 0
date.timezone = America/Sao_Paulo

Ajustante diretamente com Sed

sudo sed -i '389s/128/256/g' /etc/php/7.0/fpm/php.ini
sudo sed -i '809s/2/64/g' /etc/php/7.0/fpm/php.ini
sudo sed -i '368s/30/360/g' /etc/php/7.0/fpm/php.ini
sudo sed -i 's#;date.timezone =#date.timezone = America/Sao_Paulo#g' /etc/php/7.0/fpm/php.ini
sudo sed -i 's#;cgi.fix_pathinfo=1#cgi.fix_pathinfo = 0#g' /etc/php/7.0/fpm/php.ini

Configuração no Nginx

em /etc/nginx/sites-available/mautic

server {
    listen 80;

 server_name  quijaua.net www.quijaua.net;

 root /var/www/html/mautic;


    index index.html index.htm index.php;
    error_page 404 /index.php;

    access_log /var/log/nginx/access.log;
    error_log  /var/log/nginx/error.log error;

    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 / {
		# First attempt to serve request as file, then
		# as directory, then fall back to index.html
        # one option: try_files $uri $uri/ /index.php$is_args$args;
        try_files $uri /index.php$is_args$args;
 		# Uncomment to enable naxsi on this location
		# include /etc/nginx/naxsi.rules
	}

    # 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;
    }

    #######################################
    ##  End Mautic Specific config #####
    #######################################

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
	#
    location ~ \.php$ {
        # try_files $uri =403;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

               include snippets/fastcgi-php.conf;
               fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;

#        fastcgi_pass unix:/var/run/php5-fpm.sock;
#        fastcgi_index index.php;
        include fastcgi_params;

        fastcgi_buffer_size 128k;
        fastcgi_buffers 256 16k;
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;
    }
}


Referências

plataforma complementar para criação de template de newsletter