Linux 安装步骤

一、环境准备

安装之前需要有:web服务器(Nginx 或 Apache),Php,Mysql,Redis的运行环境 ,Linux的各操作系统的运行环境可参考下面文档,如果已经安装过则忽略

如果您的Linux Web服务器使用的是Apache,可参考 Windows安装示例 的Apache配置

二、下载Masterlab代码

```text
# ubuntu系统请在命令前加 sudo
mkdir /data/
mkdir /data/www/
cd /data/www/
wget -c http://download.masterlab.vip/masterlab-last.zip  -O masterlab.zip
unzip masterlab.zip -d ./masterlab
cd masterlab
```

三、nginx 配置

首先虚拟主机映射至 /data/www/masterlab/public
然后在/etc/nginx/conf.d/ 新增配置文件 masterlab.conf

```text
server {
    listen 80;
    # 你的域名
    server_name www.yoursite.com;

    # 程序的安装路径
    root /data/www/masterlab/public;

    index index.html index.htm index.php; 
    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    #gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_types  application/javascript  text/plain application/x-javascript  application/json  text/css application/xml text/javascript application/x-httpd-php;

    gzip_vary off;
    gzip_disable "MSIE [1-6]\.";

    # 配置设置图片格式文件
    location ~* \.(jpg|jpeg|gif|png|ico|swf)$ {
        expires 3y; 
        access_log off; 
        # gzip off;
    }

    # 配置css/js文件
    location ~* \.(css|js)$ {
        access_log off;
        expires 3y;
    }

  # 禁止用户上传目录下所有.php文件的访问,提高安全性
    location ~ ^/files/.*\.(php|php5)$ {
        deny all;
    } 
    location ~ ^/attachment/.*\.(php|php5)$ {
        deny all;
    }

    location  /{
        if (!-e $request_filename) {
                rewrite ^/((?!upload).*)$ /index.php/$1 last;
                break;
         }
    }

    location ~ \.php {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
     }

}

```

五、重启web服务器和php-fpm

访问你刚才设置的域名 http://www.yoursite.com/install ,安装图文提示进行安装,
安装过程依赖Mysql数据库,请自行安装Mysql5.7以上的版本

六、配置异步和定时程序

MasterlabSocket是Masterlab用于异步发送邮件以及定时计算数据的后台程序(该程序不运行masterlab也是可以登录使用的)
安装了php的swoole扩展

    # 进入 masterlab/bin 目录,执行
    php ./swoole_server.php start
    # 参数 start  正常启动 
    # 参数 daemon 以守护进程方式启动 
    # 参数 stop 结束进程 

七、配置缓存(可选)

安装好后,使用管理员登录系统,在“系统/缓存/修改”配置 是否启用redis缓存
启用redis缓存可提高程序的执行性能

八、配置邮件发送

安 使用管理员登录系统,在“系统/邮件配置/修改”配置邮件发送功能,如果你没有自己的smtp服务器,建议关闭邮件推送功能,否则 在masterlab执行操作时会出现卡慢的情况

Masterlab - 404
404
您所访问的页面不存在或出错了
help->pageIndex no found;
debug
Sql:
Array
(
)
TRACE:
Array
(
)
GET:
Array
(
    [md] => install-linux
    [_target] => Array
        (
            [0] => help
        )

)
POST:
Array
(
)
FILES:
Array
(
)
Include: 118
Array
(
    [0] => /data/www/masterlab_site/public/index.php
    [1] => /data/www/masterlab_site/app/globals.php
    [2] => /data/www/masterlab_site/vendor/autoload.php
    [3] => /data/www/masterlab_site/vendor/composer/autoload_real.php
    [4] => /data/www/masterlab_site/vendor/composer/platform_check.php
    [5] => /data/www/masterlab_site/vendor/composer/ClassLoader.php
    [6] => /data/www/masterlab_site/vendor/composer/autoload_static.php
    [7] => /data/www/masterlab_site/vendor/symfony/polyfill-php72/bootstrap.php
    [8] => /data/www/masterlab_site/vendor/symfony/polyfill-intl-normalizer/bootstrap.php
    [9] => /data/www/masterlab_site/vendor/ralouphie/getallheaders/src/getallheaders.php
    [10] => /data/www/masterlab_site/vendor/symfony/polyfill-ctype/bootstrap.php
    [11] => /data/www/masterlab_site/vendor/symfony/polyfill-intl-idn/bootstrap.php
    [12] => /data/www/masterlab_site/vendor/guzzlehttp/psr7/src/functions_include.php
    [13] => /data/www/masterlab_site/vendor/guzzlehttp/psr7/src/functions.php
    [14] => /data/www/masterlab_site/vendor/guzzlehttp/promises/src/functions_include.php
    [15] => /data/www/masterlab_site/vendor/guzzlehttp/promises/src/functions.php
    [16] => /data/www/masterlab_site/vendor/symfony/polyfill-mbstring/bootstrap.php
    [17] => /data/www/masterlab_site/vendor/guzzlehttp/guzzle/src/functions_include.php
    [18] => /data/www/masterlab_site/vendor/guzzlehttp/guzzle/src/functions.php
    [19] => /data/www/masterlab_site/vendor/hornet/framework/src/framework/bootstrap.php
    [20] => /data/www/masterlab_site/vendor/hornet/framework/src/framework/function.php
    [21] => /data/www/masterlab_site/vendor/hornet/framework/src/framework/FilterSqlInject.php
    [22] => /data/www/masterlab_site/vendor/hornet/framework/src/framework/HornetCoreException.php
    [23] => /data/www/masterlab_site/vendor/hornet/framework/src/framework/HornetLogicException.php
    [24] => /data/www/masterlab_site/vendor/hornet/framework/src/framework/ErrorHandler.php
    [25] => /data/www/masterlab_site/vendor/hornet/framework/src/framework/HornetEngine.php
    [26] => /data/www/masterlab_site/vendor/hornet/framework/src/framework/protocol/Iprotocol.php
    [27] => /data/www/masterlab_site/vendor/hornet/framework/src/framework/protocol/Api.php
    [28] => /data/www/masterlab_site/vendor/hornet/framework/src/framework/protocol/Ajax.php
    [29] => /data/www/masterlab_site/vendor/lcobucci/jwt/compat/class-aliases.php
    [30] => /data/www/masterlab_site/vendor/lcobucci/jwt/src/Token/Plain.php
    [31] => /data/www/masterlab_site/vendor/lcobucci/jwt/src/Token.php
    [32] => /data/www/masterlab_site/vendor/lcobucci/jwt/src/Token/Signature.php
    [33] => /data/www/masterlab_site/vendor/lcobucci/jwt/src/Signature.php
    [34] => /data/www/masterlab_site/vendor/lcobucci/jwt/compat/json-exception-polyfill.php
    [35] => /data/www/masterlab_site/vendor/lcobucci/jwt/compat/lcobucci-clock-polyfill.php
    [36] => /data/www/masterlab_site/app/function/autoload.php
    [37] => /data/www/masterlab_site/app/function/array.php
    [38] => /data/www/masterlab_site/app/function/common.php
    [39] => /data/www/masterlab_site/app/function/cryptojs-aes.php
    [40] => /data/www/masterlab_site/app/function/sql.php
    [41] => /data/www/masterlab_site/app/function/string.php
    [42] => /data/www/masterlab_site/app/function/system.php
    [43] => /data/www/masterlab_site/app/function/time.php
    [44] => /data/www/masterlab_site/app/function/upload_image.php
    [45] => /data/www/masterlab_site/app/function/web.php
    [46] => /data/www/masterlab_site/app/function/response_error.php
    [47] => /data/www/masterlab_site/app/function/excel.php
    [48] => /data/www/masterlab_site/vendor/symfony/yaml/Yaml.php
    [49] => /data/www/masterlab_site/vendor/symfony/yaml/Parser.php
    [50] => /data/www/masterlab_site/vendor/symfony/yaml/Inline.php
    [51] => /data/www/masterlab_site/vendor/symfony/yaml/Unescaper.php
    [52] => /data/www/masterlab_site/app/config/app.cfg.php
    [53] => /data/www/masterlab_site/app/constants.php
    [54] => /data/www/masterlab_site/app/config/common.cfg.php
    [55] => /data/www/masterlab_site/app/config/session.cfg.php
    [56] => /data/www/masterlab_site/app/ctrl/Help.php
    [57] => /data/www/masterlab_site/app/ctrl/BaseCtrl.php
    [58] => /data/www/masterlab_site/vendor/symfony/event-dispatcher/EventDispatcher.php
    [59] => /data/www/masterlab_site/vendor/symfony/event-dispatcher/EventDispatcherInterface.php
    [60] => /data/www/masterlab_site/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php
    [61] => /data/www/masterlab_site/app/model/SettingModel.php
    [62] => /data/www/masterlab_site/app/model/BaseDictionaryModel.php
    [63] => /data/www/masterlab_site/app/model/CacheModel.php
    [64] => /data/www/masterlab_site/app/model/DbModel.php
    [65] => /data/www/masterlab_site/app/model/BaseModel.php
    [66] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php
    [67] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Configuration.php
    [68] => /data/www/masterlab_site/vendor/doctrine/event-manager/lib/Doctrine/Common/EventManager.php
    [69] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/MySQL/Driver.php
    [70] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
    [71] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
    [72] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver.php
    [73] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ExceptionConverterDriver.php
    [74] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/VersionAwarePlatformDriver.php
    [75] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
    [76] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Connection.php
    [77] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/TransactionIsolationLevel.php
    [78] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/ParameterType.php
    [79] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/FetchMode.php
    [80] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php
    [81] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Connection.php
    [82] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
    [83] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ServerInfoAwareConnection.php
    [84] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOQueryImplementation.php
    [85] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Statement.php
    [86] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php
    [87] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Statement.php
    [88] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ResultStatement.php
    [89] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Result.php
    [90] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatementImplementations.php
    [91] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/Events.php
    [92] => /data/www/masterlab_site/lib/MyRedis.php
    [93] => /data/www/masterlab_site/vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php
    [94] => /data/www/masterlab_site/app/classes/UserAuth.php
    [95] => /data/www/masterlab_site/app/ctrl/Resource.php
    [96] => /data/www/masterlab_site/lib/parsedown/Parsedown.php
    [97] => /data/www/masterlab_site/app/view/help.php
    [98] => /data/www/masterlab_site/app/view/common/header-meta.php
    [99] => /data/www/masterlab_site/app/view/common/header-style.php
    [100] => /data/www/masterlab_site/app/view/common/header-script.php
    [101] => /data/www/masterlab_site/app/view/common/body-header.php
    [102] => /data/www/masterlab_site/app/view/common/common-footer.php
    [103] => /data/www/masterlab_site/app/view/common/siteFooter.php
    [104] => /data/www/masterlab_site/app/view/modal/login.php
    [105] => /data/www/masterlab_site/app/view/modal/signup.php
    [106] => /data/www/masterlab_site/app/view/modal/get-started.php
    [107] => /data/www/masterlab_site/app/view/modal/try.php
    [108] => /data/www/masterlab_site/app/view/modal/trial.php
    [109] => /data/www/masterlab_site/app/view/modal/buy-premium.php
    [110] => /data/www/masterlab_site/app/view/modal/loading.php
    [111] => /data/www/masterlab_site/app/view/modal/signup-failed.php
    [112] => /data/www/masterlab_site/app/view/modal/existing-account.php
    [113] => /data/www/masterlab_site/app/view/modal/unsupported-browser.php
    [114] => /data/www/masterlab_site/app/view/modal/calculate.php
    [115] => /data/www/masterlab_site/app/view/modal/sso-signup.php
    [116] => /data/www/masterlab_site/app/view/modal/i18n.php
    [117] => /data/www/masterlab_site/app/view/exception.php
)