Install

Prerequisites

  • - PHP >= 7.0
  • - MariaDB >= 10.1
  • - Composer
  • - Mod Rewrite (para Apache)

Configuring the server

E-Sculptor CMS puede correr under Apache or NGINX.

The Apache configuration file can be like the following:

<VirtualHost *:80>
   ServerName mysite.com
   ServerAlias www.mysite.com
   DocumentRoot "/var/www/mysite.com/"
   <Directory "/var/www/mysite.com/">
     AllowOverride All
   </Directory>
</VirtualHost>

The NGINX configuration file can be like the following (you must install PHP-FPM):

server {
    listen 80;
    server_name advanced.local;

    set $base_root /path/to/advanced;
    root $base_root;

    #error_log /var/log/nginx/advanced.local.error.log warn;
    #access_log /var/log/nginx/advanced.local.access.log main;
    charset UTF-8;
    client_max_body_size 128M;
    index index.php index.html;

    location / {
        root $base_root/frontend/web;
        try_files $uri $uri/ /frontend/web/index.php$is_args$args;

        # omit static files logging, and if they don't exist, avoid processing by Yii (uncomment if necessary)
        #location ~ ^/.+\.(css|js|ico|png|jpe?g|gif|svg|ttf|mp4|mov|swf|pdf|zip|rar)$ {
        #    log_not_found off;
        #    access_log off;
        #    try_files $uri =404;
        #}

        location ~ ^/assets/.+\.php(/|$) {
            deny all;
        }
    }

    location /admin {
        alias $base_root/backend/web/;

        # redirect to the URL without a trailing slash (uncomment if necessary)
        #location = /admin/ {
        #    return 301 /admin;
        #}

        # prevent the directory redirect to the URL with a trailing slash
        location = /admin {
            # if your location is "/backend", try use "/backend/backend/web/index.php$is_args$args"
            # bug ticket: https://trac.nginx.org/nginx/ticket/97
            try_files $uri /backend/web/index.php$is_args$args;
        }

        # if your location is "/backend", try use "/backend/backend/web/index.php$is_args$args"
        # bug ticket: https://trac.nginx.org/nginx/ticket/97
        try_files $uri $uri/ /backend/web/index.php$is_args$args;

        # omit static files logging, and if they don't exist, avoid processing by Yii (uncomment if necessary)
        #location ~ ^/admin/.+\.(css|js|ico|png|jpe?g|gif|svg|ttf|mp4|mov|swf|pdf|zip|rar)$ {
        #    log_not_found off;
        #    access_log off;
        #    try_files $uri =404;
        #}

        location ~ ^/admin/assets/.+\.php(/|$) {
            deny all;
        }
    }

    location ~ ^/.+\.php(/|$) {
        rewrite (?!^/((frontend|backend)/web|admin))^ /frontend/web$uri break;
        rewrite (?!^/backend/web)^/admin(/.+)$ /backend/web$1 break;

        fastcgi_pass 127.0.0.1:9000; # proxy requests to a TCP socket
        #fastcgi_pass unix:/var/run/php-fpm.sock; # proxy requests to a UNIX domain socket (check your www.conf file)
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        try_files $fastcgi_script_name =404;
    }

    location ~ /\. {
        deny all;
    }
}

Installation

Just extract the compressed files to a place on your web server accessible by Apache or NGINX and then from the command line:

First install the package globally fxp/composer-asset-plugin

composer global require "fxp/composer-asset-plugin:^1.4.1"

Then execute the init command by selecting dev or prod as the environment

php init

This will create the necessary files to run your website. Now you must configure the connection to the database and to your mail server. Edit the file @common/config/main-local.php and edit the values of the db key (dns, username, password) for the connection to your database. To configure the mailing, add the transport key separating this by a comma of the key db. The configuration should look like the following:

"transport" => [    
    "class" => "Swift_SmtpTransport",
    "host" => "your_smtp_hostname",
    "username" => "smtp_username",
    "password" => "smtp_password",
    "port" => "587", // o 25, dependiendo de su proveedor.
    "encryption" => "tls", // o ssl, dependiendo de su proveedor
]

Now, apply the migrations:

php yii migrate

This command creates the necessary tables in the database.

At last, init the root user with console command php yii init-admin.

E-Sculptor CMS is installed. Visit your site, it should work and display the message "E-Sculptor CMS is an Open Source Content Management System under GPL v3 License.".