• CentOS6.6 安装 Nodejs 环境


    yum install -y vim wget curl git lsof
    yum update -y nss curl libcurl
    wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
    source ~/.nvm/nvm.sh
    nvm install v8.12.0 && nvm use 8.9.1 && nvm alias default 8.12.0
    npm i pm2 yarn -g
    rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
    yum install -y nginx
    sudo service nginx start
    sudo service iptables stop
    sudo chkconfig iptables off
    echo "命令执行结束"
    
    # mongodb
    vim /etc/yum.repos.d/mongodb-org-4.0.repo
    
    [mongodb-org-4.0]
    name=MongoDB Repository
    baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
    gpgcheck=1
    enabled=1
    gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
    
    sudo yum install -y mongodb-org
    sudo service mongod start
    
    
    # 备份和还原 
    # 使用默认的命令行而不是mongo shell
    mongodump -h 127.0.0.1:27017 -d essay -o Documents/essay-backup
    mongorestore -h 127.0.0.1:27017 -d essay /root/essay-backup/essay
    mongo && use essay
    
    # pm2 
    ssh-keygen -t rsa # 拷贝服务器 id_rsa.pub 到github
    chmod 600 authorized_keys
    chmod 700 -R .ssh
    echo "[your public key]" > ~/.ssh/authorized_keys # 拷贝本地的 id_rsa.pub 到服务器
    
    # mac下执行 直接拷贝本地的 id_rsa.pub 到服务器
    ssh-copy-id -i ~/.ssh/id_rsa.pub root@116.196.17.78
    
    # 一定要先添加key到git,再clone
    git clone https://github.com/wmui/essay.git
    pm2 deploy ecosystem.config.js production setup
    pm2 deploy ecosystem.config.js production # 本地部署
    
  • 相关阅读:
    sigaction函数解析
    实战Nginx与PHP(FastCGI)的安装、配置与优化
    Linux下Nginx+PHP 简单安装配置
    Nginx安装配置PHP(FastCGI)环境的教程
    Linux上配置Nginx+PHP5(FastCGI)
    @JoinTable和@JoinColumn
    Spring Data JPA 之 一对一,一对多,多对多 关系映射
    MyChrome制作Chrome浏览器便携版
    注解@CrossOrigin解决跨域问题
    MySQL查看表结构及查看建表语句
  • 原文地址:https://www.cnblogs.com/yesyes/p/15375774.html
Copyright © 2020-2023  润新知