yaasoft/yii2-yaa-cms

Yaa CMS Based on Yii 2 Advanced Project Template


Keywords
cms, yii2, yaa
License
Apache-2.0

Documentation

Yee cms

YAA CMS

YaaCMS - панСль управлСния Π½Π° Yii2 PHP Framework

Установка

1. Установка Composer.

Если Composer Π΅Ρ‰Π΅ Π½Π΅ установлСн это ΠΌΠΎΠΆΠ½ΠΎ ΡΠ΄Π΅Π»Π°Ρ‚ΡŒ ΠΏΠΎ инструкции Π½Π° getcomposer.org.

Если Composer установлСн, Π²Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΡƒΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹:

composer global require "fxp/composer-asset-plugin:^1.2.0"
composer create-project --prefer-dist --stability=dev yaasoft/yii2-yaa-cms mysite.com 

2. Π˜Π½ΠΈΡ†ΠΈΠ°Π»ΠΈΠ·ΠΈΡ€ΡƒΠ΅ΠΌ установлСнноС ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅

Π’Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚Π΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ init ΠΈ Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ dev ΠΈΠ»ΠΈ prod Π² качСствС срСды.

php init

3. Настройка Π²Π΅Π± сСрвСра:

Для Apache:

 ```apacheconf
  <VirtualHost *:80>
         ServerName frontend.test
         DocumentRoot "/path/to/yii-application/frontend/web/"
         
         <Directory "/path/to/yii-application/frontend/web/">
             # use mod_rewrite for pretty URL support
             RewriteEngine on
             # If a directory or a file exists, use the request directly
             RewriteCond %{REQUEST_FILENAME} !-f
             RewriteCond %{REQUEST_FILENAME} !-d
             # Otherwise forward the request to index.php
             RewriteRule . index.php
 
             # use index.php as index file
             DirectoryIndex index.php
 
             # ...other settings...
             # Apache 2.4
             Require all granted
             
             ## Apache 2.2
             # Order allow,deny
             # Allow from all
         </Directory>
     </VirtualHost>
     
     <VirtualHost *:80>
         ServerName backend.test
         DocumentRoot "/path/to/yii-application/backend/web/"
         
         <Directory "/path/to/yii-application/backend/web/">
             # use mod_rewrite for pretty URL support
             RewriteEngine on
             # If a directory or a file exists, use the request directly
             RewriteCond %{REQUEST_FILENAME} !-f
             RewriteCond %{REQUEST_FILENAME} !-d
             # Otherwise forward the request to index.php
             RewriteRule . index.php
 
             # use index.php as index file
             DirectoryIndex index.php
 
             # ...other settings...
             # Apache 2.4
             Require all granted
             
             ## Apache 2.2
             # Order allow,deny
             # Allow from all
         </Directory>
     </VirtualHost>
 ```

Для Nginx:

 ```nginx
 server {
         charset utf-8;
         client_max_body_size 128M;
 
         listen 80; ## listen for ipv4
         #listen [::]:80 default_server ipv6only=on; ## listen for ipv6
 
         server_name frontend.test;
         root        /path/to/yii-application/frontend/web/;
         index       index.php;
 
         access_log  /path/to/yii-application/log/frontend-access.log;
         error_log   /path/to/yii-application/log/frontend-error.log;
 
         location / {
             # Redirect everything that isn't a real file to index.php
             try_files $uri $uri/ /index.php$is_args$args;
         }
 
         # uncomment to avoid processing of calls to non-existing static files by Yii
         #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
         #    try_files $uri =404;
         #}
         #error_page 404 /404.html;
 
         # deny accessing php files for the /assets directory
         location ~ ^/assets/.*\.php$ {
             deny all;
         }
 
         location ~ \.php$ {
             include fastcgi_params;
             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
             fastcgi_pass 127.0.0.1:9000;
             #fastcgi_pass unix:/var/run/php5-fpm.sock;
             try_files $uri =404;
         }
     
         location ~* /\. {
             deny all;
         }
     }
      
     server {
         charset utf-8;
         client_max_body_size 128M;
     
         listen 80; ## listen for ipv4
         #listen [::]:80 default_server ipv6only=on; ## listen for ipv6
     
         server_name backend.test;
         root        /path/to/yii-application/backend/web/;
         index       index.php;
     
         access_log  /path/to/yii-application/log/backend-access.log;
         error_log   /path/to/yii-application/log/backend-error.log;
     
         location / {
             # Redirect everything that isn't a real file to index.php
             try_files $uri $uri/ /index.php$is_args$args;
         }
     
         # uncomment to avoid processing of calls to non-existing static files by Yii
         #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
         #    try_files $uri =404;
         #}
         #error_page 404 /404.html;
 
         # deny accessing php files for the /assets directory
         location ~ ^/assets/.*\.php$ {
             deny all;
         }
 
         location ~ \.php$ {
             include fastcgi_params;
             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
             fastcgi_pass 127.0.0.1:9000;
             #fastcgi_pass unix:/var/run/php5-fpm.sock;
             try_files $uri =404;
         }
     
         location ~* /\. {
             deny all;
         }
     }
 ```

4. НастраиваСм ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅

Π‘ΠΎΠ·Π΄Π°ΠΉΡ‚Π΅ Π½ΠΎΠ²ΡƒΡŽ Π±Π°Π·Ρƒ Π΄Π°Π½Π½Ρ‹Ρ… ΠΈ внСситС ΡΠΎΠΎΡ‚Π²Π΅Ρ‚ΡΡ‚Π²ΡƒΡŽΡ‰ΠΈΠ΅ измСнСния Π² ΡΠ΅ΠΊΡ†ΠΈΡŽ components.db Ρ„Π°ΠΉΠ»Π° common/config/main-local.php

ΠŸΡ€ΠΈΠΌΠ΅Π½ΠΈΡ‚Π΅ ΠΌΠΈΠ³Ρ€Π°Ρ†ΠΈΠΈ ΠΏΡ€ΠΈ ΠΏΠΎΠΌΠΎΡ‰ΠΈ консольной ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹:

php yii migrate --migrationLookup=@yeesoft/yii2-yee-core/migrations/,@yeesoft/yii2-yee-auth/migrations/,@yeesoft/yii2-yee-settings/migrations/,@yeesoft/yii2-yee-menu/migrations/,@yeesoft/yii2-yee-user/migrations/,@yeesoft/yii2-yee-translation/migrations/,@yeesoft/yii2-yee-media/migrations/,@yeesoft/yii2-yee-post/migrations/,@yeesoft/yii2-yee-page/migrations/,@yeesoft/yii2-comments/migrations/,@yeesoft/yii2-yee-comment/migrations/,@yeesoft/yii2-yee-seo/migrations/.

6. Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Администратора

Π’Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚Π΅ Π² консоли: php yii init-admin ΠΈ Π²Π²Π΅Π΄ΠΈΡ‚Π΅ Π΄Π°Π½Π½Ρ‹Π΅.

7. НастраиваСм ΠΏΠΎΡ‡Ρ‚Ρƒ

ВнСситС измСнСния Π² ΡΠ΅ΠΊΡ†ΠΈΡŽ ['components']['mailer'] Π² Ρ„Π°ΠΉΠ»Π΅ common/config/main-local.php.

На этом установка Yaa Π‘ms Π·Π°Π²Π΅Ρ€ΡˆΠ΅Π½Π°.