ubuntu下推荐使用apt包管理器来安装软件

Ubuntu版本

18.04


为APT设置软件源

  1. 国内网络的建议替换系统源,用下面内容替换掉 /etc/apt/sources.list 这个文件。 sudo vim /etc/apt/sources.list

     deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
     deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
     deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
     deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
     deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
     deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
     deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
     deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
     deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
     deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
  2. 依次执行

     sudo apt-get update
     sudo apt-get upgrade
     sudo apt-get install -y software-properties-common
     sudo apt-get install -y vim wget
     sudo apt install -y unzip

安装php

  1. 添加PPA源

     sudo add-apt-repository ppa:ondrej/nginx
     按回车继续
     sudo add-apt-repository ppa:ondrej/php
     按回车继续
  2. apt-get安装php

     sudo apt-get install -y php7.2
     sudo apt-get install -y php7.2-bcmath \
      php7.2-fpm \
      php7.2-bz2 \
      php7.2-dba \
      php7.2-enchant \
      php7.2-imap \
      php7.2-interbase \
      php7.2-intl \
      php7.2-mbstring \
      php7.2-phpdbg \
      php7.2-soap \
      php7.2-sybase \
      php7.2-xsl \
      php7.2-zip \
      php7.2-xmlrpc \
      php7.2-xml \
      php7.2-tidy \
      php7.2-sqlite3 \
      php7.2-snmp \
      php7.2-recode \
      php7.2-readline \
      php7.2-pspell \
      php7.2-pgsql \
      php7.2-opcache \
      php7.2-odbc \
      php7.2-mysql \
      php7.2-pdo-mysql \
      php7.2-ldap \
      php7.2-json \
      php7.2-gmp \
      php7.2-gd \
      php7.2-dev \
      php7.2-curl \
      php7.2-common \
      php7.2-cli \
      php7.2-cgi \
      php7.2-redis 

    如果某些扩展安装不成功,可以再次执行如

    sudo apt-get install php7.2-mbstring
    sudo apt-get install php7.2-pdo-mysql
  3. 查看版本

     php7.2 -v
     php-fpm7.2 -v
  4. 修改php-fpm配置

     sudo vim /etc/php/7.2/fpm/pool.d/www.conf   

    找到

        listen = /run/php/php7.2-fpm.sock 

    ` 替换成

    listen = 0.0.0.0:9000
  5. 启动php-fpm

     sudo service php7.2-fpm stop
     sudo service php7.2-fpm start

安装nginx

  1. 安装命令

     sudo apt-get install nginx
  2. 启动nginx

     sudo systemctl start nginx.service
     或
     sudo service nginx start

安装mysql

  1. 安装命令

     wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb
     sudo dpkg -i ./percona-release_latest.generic_all.deb
     sudo apt-get update
     sudo apt-get install percona-server-server-5.7

    安装过程会要求输入root账号密码,要记好

  2. 停止mysql

     sudo systemctl stop mysql.service
  3. 取消mysql的严格模式和新增对ngram的支持

    修改配置文件/etc/mysql/percona-server.conf.d/mysqld.cnf 替换掉sql_mode的值和新增ngram_token_size

     sql_mode=NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER
     ngram_token_size=2
  4. 启动mysql

     sudo systemctl start mysql.service

安装redis

  1. 安装命令
     sudo apt-get install redis-server
  2. 启动redis
     sudo systemctl start redis.service
Masterlab - 404
404
您所访问的页面不存在或出错了
help->pageIndex no found;
debug
Sql:
Array
(
)
TRACE:
Array
(
)
GET:
Array
(
    [md] => setup_ubuntu
    [_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
)