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
.