Linux 宝塔环境 安装示例

注:该教程在centos7 64位操作系统下测试通过,其他Linux系统过程相似
这里仅仅是示例,如果示例安装成功,那么将你的域名和相应的路径值修改就可以
示例域名: www.masterlab.ce ,请根据自己的情况修改
请在HOSTS文件中添加: 127.0.0.1 www.masterlab.ce

1.安装宝塔

# Centos安装脚本
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh

# Ubuntu/Deepin安装脚本
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && sudo bash install.sh

# Debian安装脚本
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && bash install.sh

# Fedora安装脚本
wget -O install.sh http://download.bt.cn/install/install.sh && bash install.sh

根据提示进行安装,安装成功后会显示宝塔的web访问地址和账号密码,记下来并登录。
接着安装运行环境: Nginx Php7.3 Mysql5.7

1. 下载最新masterlab的完整代码 https://download.masterlab.vip/masterlab-last.zip

解压到 /www/masterlab 目录下,解压后的目录结构如下:

    /www/masterlab            
      |--   app   
      |--   bin    
      |--   lib    
      |--   travis
      |--   vendor
      |--   ...
      |--   composer.json
      |--   env.ini-example       
      |--   LICENSE
      |--   php.ini    
      |--   README.md

2. 添加网站,点击宝塔“网站”面板创建网站

同时把数据库创建了,后面安装会用上
1cut-202011241811003464.png

3. 设置运行目录

1cut-202011241811341801.png

4. 修改伪静态

对于Web服务器是Nginx的: 1cut-202002071702442457.png

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

或者

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

对于Web服务器是Apache的:

 <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>


5. 访问 http://www.masterlab.ce/install/

安装过程有些目录需要给 www 用户赋予写入权限

chown -R www:www /www/masterlab/public/install/
chown -R www:www /www/masterlab/public/attachment/
chown -R www:www /www/masterlab/storage/
chown -R www:www /www/masterlab/app/config/
chown -R www:www /www/masterlab/bin/
chown -R www:www /www/masterlab/upgrade/

按照提示进行安装

6. 下载和运行 MasterlabSocket

Centos和Windows系统已经编译成二进制,可以直接使用,
https://github.com/gopeak/masterlab_socket/releases
下载放置在 masterlab/bin 目录下,其他操作系统自行编译。

运行命令

cd /www/masterlab/bin
chmod +x ./masterlab_socket
./masterlab_socket start -d

如果安装了php的swoole扩展, 可代替masterlab_socket:

    # 进入 masterlab/bin 目录,执行
    php ./swoole_server.php

good luck~~~

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

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