# yii2-cms **Repository Path**: chiw/yii2-cms ## Basic Information - **Project Name**: yii2-cms - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-06-05 - **Last Updated**: 2024-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Yii2 CMS 一款基于YII2框架的内容管理系统 安装 ------------ ### 安装Yii2 CMS 1. 通过Git安装 ```bash cd /var/www/ git clone https://git.oschina.net/kzeng/yii2-cms.git mysite.com ``` 2. 初始化 执行 `init` 命令,然后选择 `dev` or `prod` 环境. ```bash cd /var/www/mysite.com/ php init ``` 3. 配置Web服务器: Apache 服务器参考配置如下: ```apacheconf ServerName mysite.com ServerAlias www.mysite.com DocumentRoot "/var/www/mysite.com/" AllowOverride All ``` Nginx 服务器参考配置如下: ```nginx server { charset utf-8; client_max_body_size 200M; listen 80; server_name mysite.com; root /var/www/mysite.com; location / { root /var/www/mysite.com/frontend/web; try_files $uri /frontend/web/index.php?$args; # avoiding processing of calls to non-existing static files by Yii location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { access_log off; expires 360d; try_files $uri =404; } } location /admin { alias /var/www/mysite.com/backend/web; rewrite ^(/admin)/$ $1 permanent; try_files $uri /backend/web/index.php?$args; } # avoiding processing of calls to non-existing static files by Yii location ~ ^/admin/(.+\.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar))$ { access_log off; expires 360d; rewrite ^/admin/(.+)$ /backend/web/$1 break; rewrite ^/admin/(.+)/(.+)$ /backend/web/$1/$2 break; try_files $uri =404; } location ~ \.php$ { include fastcgi_params; # check your /etc/php5/fpm/pool.d/www.conf to see if PHP-FPM is listening on a socket or port fastcgi_pass unix:/var/run/php5-fpm.sock; ## listen for socket #fastcgi_pass 127.0.0.1:9000; ## listen for port fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; try_files $uri =404; } #error_page 404 /404.html; location = /requirements.php { deny all; } location ~ \.(ht|svn|git) { deny all; } } ``` 4. 创建一个新数据库,调整`components['db']`配置在`common/config/main-local.php`. 5. 在控制台执行迁徙命令 ``` 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. 在控制台创建一个root user: `php yii init-admin`. 7. 配置 `['components']['mailer']` 在 `common/config/main-local.php` 中. 8. 访问前台:`mysite.com` 访问后台:`mysite.com/admin` 待解决的问题 ------------ ~~1. 后台Carousel(轮播图)管理模块,上传图片功能需完善。 (已解决)~~ 2. 后台自定义字段模块,怎么用? 3. 后台HTML Block模块,怎么用? 4. 本地化,待完善 5. yii2-oauth,怎么用?怎么把社交帐号登录集成进来? 6. contact(联系我们)功能需完善, 建表需用migrate 7. 已完成功能模块需规范,composer打包机制? 8. yee-gii的用法