Tutorial - i-Educar 2.x.x e ubuntu 18.04

Tutorial de instação do i-Educar 2.x.x e do sistema operacional ubuntu 18.04.

Instalação em servidor NGINX - PHP - POSTGRESQL

apt-get update

apt-get install nginx -y

apt-get install software-properties-common -y	

add-apt-repository ppa:ondrej/php -y

apt-get update	

apt-get install -y php php-bcmath php-curl php-dompdf php-mbstring php-pgsql php-xml php-zip php-fpm php-gd

apt-get install postgresql postgresql-contrib -y

apt-get update

BAIXAR I-EDUCAR

https://github.com/portabilis/i-educar/releases

chmod -R 755 /var/www/html

rm /etc/nginx/sites-available/default

nano /etc/nginx/sites-available/default

Copiar o arquivo abaixo no i-educar	

server {

index index.php index.html index.htm;
server_name MEU SITE.com.br www.MEU SITE.com.br;
error_log  /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html/public;

location ~ ^/intranet/?$ {
    rewrite ^.*$ /intranet/index.php redirect;
}

location ~ /module/(.*)/(styles|scripts|imagens)/(.*) {
    rewrite ^/module/(.*)/(imagens|scripts|styles)/(.*)$ /intranet/$2/$3 break;
}

location ~ /module/(.*)/(.*) {
    rewrite ^/module/(.*/)(.*intranet/.*)$ /$2 redirect;
    rewrite ^/module/(.*/)(.*index\.php)$ /$2 redirect;
    rewrite ^/module/(.*/)(.*logof\.php)$ /intranet/logof.php redirect;
    rewrite ^/module/(.*/)(.*meusdados\.php)$ /intranet/meusdados.php redirect;
    rewrite ^/module/(.*/)(.*_xml.*)(\.php)$ /intranet/$2.php redirect;
    rewrite ^/module/(.*/)(.*erro_banco\.php)$ /intranet/erro_banco.php redirect;
    rewrite ^/module/(.*/)(.*educar_pesquisa_cliente_lst\.php)$ /intranet/educar_pesquisa_cliente_lst.php redirect;
    rewrite ^/module/(.*/)(.*educar_pesquisa_obra_lst\.php)$ /intranet/educar_pesquisa_obra_lst.php redirect;
    rewrite ^/module/(.*)$ /module/index.php last;
}

location ~ ^(/intranet.*\.php|/modules.*\.php|/module/) {
    try_files /index.php =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
}

location ~ \.php {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
}

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

}

cd /var/www/html/

curl -s https://getcomposer.org/installer | php

php composer.phar install

apt-get install -y composer

apt-get update


nano /etc/nginx/nginx.conf

server_names_hash_bucket_size 64;


nginx -t

systemctl restart nginx

nano /etc/hosts

191.252.219.148 MEU SITE.com.br
191.252.219.148 www.MEU SITE.com.br


chown -R www-data:www-data /var/www/html/


nano /var/www/html/.env

DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=ieducar
DB_USERNAME=ieducar
DB_PASSWORD=DIGITE SUA SENHA

service postgresql restart

sudo -u postgres createuser ieducar
sudo -u postgres psql
alter user ieducar with encrypted password 'DIGITE SUA SENHA';
\q

sudo -u postgres psql
alter user ieducar with SUPERUSER;
\q

sudo -u postgres createdb ieducar
sudo -u postgres psql
grant all privileges on database ieducar to ieducar;
\q

nano /etc/postgresql/10/main/pg_hba.conf

# "local" is for Unix domain socket connections only
local all all peer

por:
# “local” is for Unix domain socket connections only
local all all md5

service postgresql restart

Instalação do i-Educar
MEU SITE/install.php