CentOS ,系统的初步使--应用(mariaDB, nvm,

2018-10-12  本文已影响0人  如果你还记得我是小双鱼

CentOs

    cat /etc/issue
centos版本

安装 MariaDB

https://downloads.mariadb.org/mariadb/repositories

 # MariaDB 10.3 CentOS repository list - created 2018-10-11 03:47 
 # http://downloads.mariadb.org/mariadb/repositories/
 [mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos6-amd64
gpgkey= https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
  cd /etc/yum.repos.d/
  touch MariaDB.repo
  vim MariaDB.repo
  sudo yum install MariaDB-server MariaDB-client
* 此时出现下载速度过慢,安装失败。

配置换为国内源

 # MariaDB 10.3 CentOS repository list - created 2018-10-11 03:47 
 # http://downloads.mariadb.org/mariadb/repositories/
 [mariadb]
name = MariaDB
baseurl = http://mirrors.ustc.edu.cn/mariadb/yum/10.3/centos6-amd64
gpgkey= https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
image.png

nvm 安装 node

  curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
  nvm
nvm安装完成
  // 使用nvm 安装node
  nvm install 8.12.0
  // 当前使用 node 版本
  nvm use 8.12.0 

⚠️ 我安装的时候系统并未找到node 版本
手动 在配置文件中添加了 .bashrc

  export PATH="/root/.nvm/versions/node/v8.12:::qq.0/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

安装pm2

  npm install pm2 -g
  pm2 completion install

启动pm2

事例:

  1. 创建文件夹 koa
    目录
    koa
    |-- package.json
    |-- pm2
    |    |-- production.json
    |-- koa.js
    |-- node_modules
    | ... ...
  2. koa.js 监听8000端口
    ⚠️ 阿里云服务器只允许规定端口访问
    需要添加安全组规则允许外网访问该端口


    添加安全组规则
  // 启动pm2 进程
  pm2 start xxx/xxx.json
完成
上一篇 下一篇

猜你喜欢

热点阅读