店滴AI系统安装与部署

店滴AI入门 店滴AI入门 1296 人阅读 | 0 人回复

发表于 2020-7-17 11:47:48 | 显示全部楼层 |阅读模式

环境准备:

基础环境要求:

nginx+php7.2+mysql+redis

nodejs安装教程:

安装包: 链接:[url=https://pan.baidu.com/s/1ZCatZ2WzQw-ouqJmIhYSWg]https://pan.baidu.com/s/1ZCatZ2WzQw-ouqJmIhYSWg[/url]  提取码:rgfy

composer安装教程:

安装包:链接:[url=https://pan.baidu.com/s/1GoXtcuBzblw5gdkMZCgdSg]https://pan.baidu.com/s/1GoXtcuBzblw5gdkMZCgdSg[/url]   提取码:hxlo

使用阿里云镜像

使用阿里云镜像:composer config -g repo.packagist composer [url=https://mirrors.aliyun.com/composer/]https://mirrors.aliyun.com/composer/[/url]

git安装与使用教程:

安装包:百度云盘:[url=https://pan.baidu.com/s/10ULSP6bnVp-T798hKbtJWA]https://pan.baidu.com/s/10ULSP6bnVp-T798hKbtJWA[/url]  提取码:sakx

linux系统:

宝塔安装教程:[url=https://www.bt.cn/bbs/thread-19376-1-1.html]https://www.bt.cn/bbs/thread-19376-1-1.html[/url]

windows系统:

upupw集成环境 百度云盘:[url=https://pan.baidu.com/s/1OpJk0M7ltLo7FrQA5iQWew]https://pan.baidu.com/s/1OpJk0M7ltLo7FrQA5iQWew[/url]  提取码:unrv

第一步:composer 创建或git下载代码,强烈建议composer创建

composer创建

composer create-project yii-diandi/firetech

git下载

git clone [url=https://gitee.com/wayfiretech_admin/firetech.git]https://gitee.com/wayfiretech_admin/firetech.git[/url]

第二步:配置nginx

server
{
    listen 80;
        listen 443 ssl http2;
    server_name demo.hopesfire.com;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/demo.hopesfire.com/frontend/web;
     add_header Access-Control-Allow-Origin *;
     add_header Access-Control-Allow-Headers X-Requested-With,Authorization,Content-Type,access-token,bloc-id,store-id;
     add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    ssl_certificate    /www/server/panel/vhost/cert/demo.hopesfire.com/fullchain.pem;
    ssl_certificate_key    /www/server/panel/vhost/cert/demo.hopesfire.com/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    error_page 497  https://$host$request_uri;

    #SSL-END

    #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    #ERROR-PAGE-END

    #PHP-INFO-START  PHP引用配置,可以注释或修改
    include enable-php-72.conf;
    #PHP-INFO-END

    #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
    include /www/server/panel/vhost/rewrite/demo.hopesfire.com.conf;
    #REWRITE-END

    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }

    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
        allow all;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
        error_log off;
        access_log /dev/null;
    }

    location ~ .*\.(js|css)?$
    {
        expires      12h;
        error_log off;
        access_log /dev/null; 
    }
     location /backend {
            index index.php index.html;
            if (!-e $request_filename)
            {
                rewrite ^/backend/(.*)$ /backend/index.php last;
            }
        }
        location /api {
            index index.php index.html;
            if (!-e $request_filename)
            {
                rewrite ^/api/(.*)$ /api/index.php last;
            }
            if (!-f $request_filename){
                set $rule_0 1$rule_0;
            }
        }
    access_log  /www/wwwlogs/demo.hopesfire.com.log;
    error_log  /www/wwwlogs/demo.hopesfire.com.error.log;
}

第三步:配置数据库

重要!重要!重要!

全局配置文件与console的数据库配置文件内容相同

全局数据库配置文件: common\config\main-local.php 
console数据库配置文件:console\config\main-local.php

配置参数内容


return [
    'components' => [
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=127.0.0.1;dbname=locai',
            'tablePrefix' => 'dd_',
            'username' => 'root',
            'password' => 'root',
            'charset' => 'utf8',
            'attributes' => [
                PDO::ATTR_STRINGIFY_FETCHES => false,
                PDO::ATTR_EMULATE_PREPARES => false,
            ],
            'enableSchemaCache' => true,

            // Duration of schema cache.
            'schemaCacheDuration' => 3600,

            // Name of the cache component used to store schema information
            'schemaCache' => 'cache',
        ],
        // 'mongodb' => [
        //     'class' => '\yii\mongodb\Connection',
        //     'dsn' => 'mongodb://@localhost:27017/mydatabase',
        //     'options' => [
        //         'username' => 'ceshi',
        //         'password' => 'Password',
        //     ],
        // ],
         /* ------ 缓存 ------ **/
        'cache' => [
            'class' => 'yii\redis\Cache',
        ],
        /* ------ REDIS ------ **/
        'redis' => [
            'class' => 'yii\redis\Connection',
            'hostname' => 'localhost',
            'port' => 6379,
            'database' => 2,
        ],

    ],
    'language' => 'zh-CN',
];

第四步:恢复数据库

 php ./yii migrate/up

第五步:确保以下几个目录有写入权限

frontend\runtime
frontend\web\assets
frontend\web\attachment
backend\runtime

第六步:访问地址

前台

www.domain.com

后台

www.domain.com/backend

接口地址

www.domain.com/api
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

热门推荐