本系统的部署和环境要求
本系统基于WeiCot Framework 进行开发
环境要求
建议环境 LNMP
支持Apache 环境
PHP 版本
可适配的环境:
我们分别在 php5.6、php7.1、php7.2、php-7.3 的环境中进行了实际测试,全部通过。
建议php版本:
PHP 7.2.33
MYSQL版本
建议MYSQL版本 5.6.48
支持 Mariadb
建议操作系统 centos 7 或以上版本
环境搭建
环境搭建方式有两种
自己搭建 服务器环境搭建教程
LNMP一键安装包 LNMP一键安装包
静态路由规则配置
Nginx 环境配置文件 以lnmp 为例
nginx 下系统主配置文件 /etc/nginx/WeiCotFramework.conf
location / {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ @handler; ## If missing pass the URI to WeiCot-Framework's front handler
expires 30d; ## Assume all files are cachable
}
## These locations would be hidden by .htaccess normally
location /app/ { deny all; }
location /vendor/ { deny all; }
location /lib/ { deny all; }
location /bin/ { deny all; }
location /media/downloadable/ { deny all; }
location /pkginfo/ { deny all; }
location /report/config.xml { deny all; }
location /var/ { deny all; }
location /var/export/ { ## Allow admins only to view export folder
auth_basic "Restricted"; ## Message shown in login window
auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
autoindex on;
}
location /. { ## Disable .htaccess and other hidden files
return 404;
}
location @handler { ## WeiCot Framework uses a common front handler
rewrite / /index.php;
}
location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
rewrite ^(.*.php)/ $1 last;
}
lnmp 下 WeiCot Framework 虚拟配置文件位置 /etc/nginx/vhost/wf.conf
server
{
listen 80;
#listen [::]:80;
server_name wf.weicot.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/wf;
include WeiCotFramework.conf;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/wf.weicot.log;
}
Apache 规则配置文件
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
系统的配置文件说明
/app/etc/Config.php
<?php
/**
* Created by PhpStorm.
* User: jiang
* Date: 2018/11/18
* Time: 11:50
* ---------etc 配置文件
* Config.ini 空的配置文件可自由配置(2016/5/23/File::getConfig() 获取)
* Config.php 应用层配置文件
* Initialization.php 初始化文件
*/
return [
"site" => [ //站点配置
'abbreviation' => '易定制', //简称
'copyright' => '易定制智能供应链服务系统 (易定制) 版本:v' . EDZCV . ' Copyright © 2016-3000 weicot.com 联系我们:<a href="mailto:1050653098@qq.com">1050653098@qq.com</a>',
'logo' => 'skin/frontend/images/logo3.png', //前台logo
'admin_logo' => 'skin/frontend/images/logo6.png', //后台logo
'protocol' => 'http', //协议配置
'site_dir' => '', //网站存放的目录 example/'
'admin_path' => 'admins', //后台管理员类名
'open_registration' => true, //开放注册
'close_site' => false, //关闭站点
'layui_version' => 1545041465480, // 为了更新 js 缓存
'contact_ht' => '1050653098', //服务QQ
],
'theme' => [ //页面所使用的主题
'template_dir' => "app/code/", //模板路径默认路径 app/code/前后端分离的路径 skin/frontend/template
"adminhtml" => "default", // 后台主题 adminhtml
"frontend" => "default", // 前台主题 frontend
],
'module' => [ //系统中一些模块配置文件管理
'_disable' => [], //禁用的的模块
'_sql_install' => true, //启用数据库自动安装
'custom' => [
'design_tools' => true, //默认设计器模块
'default_design_module' => 'Soa',
],
],
"debug" => [
'developer_ip' => [], //开发者所在的ip
'display_errors' => true, //显示错误信息
'show_path' => false,//是否 显示Controller地址地址及类名 显示Block地址及类名 显示Template地址及类名 false
'design_tools' => false, //设计工具是否开启 debug
],
"task" => [ //各种任务执行路径
'run_dir' => '/home/wwwroot/erp', //定时任务运行路径
'work_dir' => '/home/wwwroot/erp',
'local_host' => 'http://127.0.0.1/media/' //本地工作域名
],
"sync" => [ // 同步配置
'image' => [ //图片同步服务器
'host' => "127.0.0.1", //本地同步服务器 ip
'port' => '2015', //本地同步服务器 host
'sync_domain' => 'http://oss1.amazon.ncaz.com', //同步服务器 host
'default_domain' => 'http://oss1.amazon.ncaz.com', //用户模板中默认的导出域名
],
"im" => [] // im 消息同步服务器
],
"components" => [ //提供的组件
"mongoDB" => [],
"elasticsearch" => [],
"redis" => [],
"swoole" => [],
"database" => [ // 数据库配制
//pdo persistent 长链接
'pdo_persistent' => true,
//pdo 直接输出错误
'show_error' => false,
//错误日志文件
'log_file' => './var/log/error_long_name.log',
// 数据库类型
'type' => 'mysql',
// 数据库连接DSN配置
'dsn' => '',
// 服务器地址
'hostname' => '127.0.0.1',
// 数据库名
'database' => 'you database ',
// 数据库用户名
'username' => 'username',
// 数据库密码
'password' => 'password',
// 数据库连接端口
'hostport' => '3306',
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => 'utf8',
// 数据库表前缀
'prefix' => '',
// 数据库调试模式
'debug' => false,
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 是否严格检查字段是否存在
'fields_strict' => true,
]
],
"security" => [ //安全配置
'no_login' => [], //通过这里配置将会覆该模块的控制器的权限配置
'ip_control' => [ // ip 列表控制
'type' => 'blacklist', // whitelist
'list' => []
]
]
];